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, #messages, #status, #task
Instance Method Summary collapse
-
#initialize(proxy, want, options = {}) ⇒ AlarmCollector
constructor
A new instance of AlarmCollector.
- #type_match?(message) ⇒ Boolean
Methods inherited from Collector
#cancel, #cancelled?, #collect, #collect!, #collecting?, #complete, #describe, #describe_progress, #do_stop, #done?, #ingoing?, #inspect, #keep, #notify, #notify_disconnect, #notify_error, #notify_schema_error, #ok!, #ok?, #outgoing?, #perform_match, #ready?, #reject_not_ack, #reset, #start, #timeout?, #use_task, #wait, #wait!
Methods inherited from Listener
#change_notifier, #notify, #notify_error
Methods included from Inspect
Constructor Details
#initialize(proxy, want, 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, want, ={} @want = want super proxy, .merge( type: 'Alarm', title:'alarm' ) end |
Instance Method Details
#type_match?(message) ⇒ Boolean
12 13 14 15 16 17 18 |
# File 'lib/rsmp/collect/alarm_collector.rb', line 12 def type_match? return false if super() == false [:aCId, :aSp, :ack, :aS, :sS, :cat, :pri].each do |key| return false if @want[key] && @want[key] != .attribute(key.to_s) end true end |