Class: Fusuma::Plugin::Buffers::AppmatcherBuffer

Inherits:
Buffer
  • Object
show all
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

Parameters:

  • event (Event)


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_expiredObject



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

Returns:

  • (Boolean)


21
22
23
# File 'lib/fusuma/plugin/buffers/appmatcher_buffer.rb', line 21

def empty?
  @events.empty?
end