diff --git a/lib/fusuma/plugin/buffers/buffer.rb b/lib/fusuma/plugin/buffers/buffer.rb index 600aad3..f9b2bfe 100644 --- a/lib/fusuma/plugin/buffers/buffer.rb +++ b/lib/fusuma/plugin/buffers/buffer.rb @@ -31,6 +31,11 @@ def buffer(event) def clear_expired(current_time: Time.now) end + # @return [TrueClass, FalseClass] + def empty? + @events.empty? + end + # clear buffer def clear @events.clear diff --git a/lib/fusuma/plugin/buffers/gesture_buffer.rb b/lib/fusuma/plugin/buffers/gesture_buffer.rb index 5ce17b9..72de536 100644 --- a/lib/fusuma/plugin/buffers/gesture_buffer.rb +++ b/lib/fusuma/plugin/buffers/gesture_buffer.rb @@ -127,10 +127,6 @@ def gesture @events.last.record.gesture end - def empty? - @events.empty? - end - def select_by_events(&block) return enum_for(:select_by_events) unless block diff --git a/lib/fusuma/plugin/buffers/timer_buffer.rb b/lib/fusuma/plugin/buffers/timer_buffer.rb index 441bced..e31863a 100644 --- a/lib/fusuma/plugin/buffers/timer_buffer.rb +++ b/lib/fusuma/plugin/buffers/timer_buffer.rb @@ -34,10 +34,6 @@ def clear_expired(current_time: Time.now) @events.delete(e) end end - - def empty? - @events.empty? - end end end end