Class: Fusuma::Plugin::Buffers::AppmatcherBuffer
- Inherits:
-
Buffer
- Object
- Buffer
- Fusuma::Plugin::Buffers::AppmatcherBuffer
- Defined in:
- lib/fusuma/plugin/buffers/appmatcher_buffer.rb
Overview
Buffer events having KeypressRecord
Constant Summary collapse
- DEFAULT_SOURCE =
"appmatcher_input"
Instance Method Summary collapse
Instance Method Details
#buffer(event) ⇒ Object
11 12 13 14 15 |
# File 'lib/fusuma/plugin/buffers/appmatcher_buffer.rb', line 11 def buffer(event) return if event&.tag != source @events.push(event) end |
#clear_expired ⇒ Object
17 18 19 |
# File 'lib/fusuma/plugin/buffers/appmatcher_buffer.rb', line 17 def clear_expired(*) @events = [@events.last] if @events.size > 100 end |
#empty? ⇒ Boolean
21 22 23 |
# File 'lib/fusuma/plugin/buffers/appmatcher_buffer.rb', line 21 def empty? @events.empty? end |