Class: Fusuma::Plugin::Detectors::Detector
- Inherits:
-
Base
- Object
- Base
- Fusuma::Plugin::Detectors::Detector
show all
- Defined in:
- lib/fusuma/plugin/detectors/detector.rb
Overview
Instance Method Summary
collapse
Methods inherited from Base
#config_index, #config_param_types, #config_params, inherited, plugins
Instance Method Details
22
23
24
25
|
# File 'lib/fusuma/plugin/detectors/detector.rb', line 22
def create_event(record:)
@last_time = Time.now
Events::Event.new(time: Time.now, tag: tag, record: record)
end
|
#detect(_buffers) ⇒ Event, NilClass
14
15
16
17
18
|
# File 'lib/fusuma/plugin/detectors/detector.rb', line 14
def detect(_buffers)
raise NotImplementedError, "override #{self.class.name}##{__method__}"
end
|
#last_time ⇒ Object
27
28
29
|
# File 'lib/fusuma/plugin/detectors/detector.rb', line 27
def last_time
@last_time ||= Time.now
end
|
#tag ⇒ Object
31
32
33
|
# File 'lib/fusuma/plugin/detectors/detector.rb', line 31
def tag
self.class.name.split('Detectors::').last.underscore
end
|
#type ⇒ Object
35
36
37
|
# File 'lib/fusuma/plugin/detectors/detector.rb', line 35
def type
self.class.name.underscore.split('/').last.gsub('_detector', '')
end
|