Class: Fusuma::Plugin::Detectors::AppmatcherDetector
- Inherits:
-
Detector
- Object
- Detector
- Fusuma::Plugin::Detectors::AppmatcherDetector
- Defined in:
- lib/fusuma/plugin/detectors/appmatcher_detector.rb
Overview
Detect KeypressEvent from KeypressBuffer
Constant Summary collapse
- SOURCES =
['appmatcher']
- BUFFER_TYPE =
'appmatcher'- DEFAULT_NAME =
'global'
Instance Method Summary collapse
- #detect(buffers) ⇒ Event, NilClass
-
#watch? ⇒ Boolean
Always watch buffers and detect them.
Instance Method Details
#detect(buffers) ⇒ Event, NilClass
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/fusuma/plugin/detectors/appmatcher_detector.rb', line 20 def detect(buffers) buffer = buffers.find { |b| b.type == BUFFER_TYPE } return if buffer.empty? record = buffer.events.last.record context_record = Events::Records::ContextRecord.new( name: 'application', value: record.name ) create_event(record: context_record) end |
#watch? ⇒ Boolean
Always watch buffers and detect them.
13 14 15 |
# File 'lib/fusuma/plugin/detectors/appmatcher_detector.rb', line 13 def watch? true end |