Class: RSMP::AlarmCollector
- Defined in:
- lib/rsmp/collect/alarm_collector.rb
Overview
Class for waiting for specific command responses
Instance Attribute Summary
Attributes inherited from Collector
#condition, #error, #m_id, #messages, #status, #task
Attributes included from Logging
Instance Method Summary collapse
- #acceptable?(message) ⇒ Boolean
-
#describe_matcher ⇒ Object
return a string that describes what we’re collecting.
-
#initialize(proxy, options = {}) ⇒ AlarmCollector
constructor
A new instance of AlarmCollector.
Methods inherited from Collector
#cancel, #collect, #collect!, #complete, #describe, #do_stop, #done?, #incomplete, #inspect, #keep, #make_title, #ok!, #perform_match, #receive, #receive_disconnect, #receive_error, #receive_schema_error, #reject_not_ack, #reset, #start, #use_task, #wait, #wait!
Methods included from Logging
#author, #initialize_logging, #log
Methods included from Collector::Reporting
#describe_num_and_type, #describe_progress, #describe_types, #identifier
Methods included from Collector::Status
#cancelled?, #collecting?, #ingoing?, #ok?, #outgoing?, #ready?, #timeout?
Methods included from Receiver
#accept_message?, #handle_message, #initialize_receiver, #receive, #receive_error, #reject_message?, #start_receiving, #stop_receiving
Methods included from Inspect
Constructor Details
#initialize(proxy, options = {}) ⇒ AlarmCollector
Returns a new instance of AlarmCollector.
4 5 6 7 8 9 10 |
# File 'lib/rsmp/collect/alarm_collector.rb', line 4 def initialize(proxy, = {}) @matcher = [:matcher] || {} super(proxy, .merge( filter: RSMP::Filter.new(ingoing: true, outgoing: false, type: 'Alarm'), title: 'alarm' )) end |
Instance Method Details
#acceptable?(message) ⇒ Boolean
12 13 14 15 16 17 18 |
# File 'lib/rsmp/collect/alarm_collector.rb', line 12 def acceptable?() return false if super == false return false unless fixed_attributes_match?() return false unless rvs_attributes_match?() true end |
#describe_matcher ⇒ Object
return a string that describes what we’re collecting
53 54 55 |
# File 'lib/rsmp/collect/alarm_collector.rb', line 53 def describe_matcher "#{describe_num_and_type} #{{ component: @options[:component] }.merge(@matcher).compact}" end |