Class: RSMP::AlarmCollector

Inherits:
Collector show all
Defined in:
lib/rsmp/collect/alarm_collector.rb

Overview

Class for waiting for specific command responses

Instance Attribute Summary

Attributes inherited from Collector

#initiator, #m_id, #messages

Attributes included from Logging

#archive, #logger

Instance Method Summary collapse

Methods inherited from Collector

#active?, #build_collection, #cancel, #collect, #collect!, #complete, #crash, #describe, #done?, #fail, #incomplete, #inspect, #keep, #make_title, #perform_match?, #receive, #receive_connection_ended, #receive_event, #receive_invalid_message, #reject_not_ack?, #reset, #start, #stop, #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 Receiver

#accept_message?, #handle_message, #initialize_receiver, #inspect, #receive, #receive_event, #reject_message?, #start_receiving, #stop_receiving

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, options = {})
  @matcher = options[:matcher] || {}
  super(proxy, options.merge(
    filter: RSMP::Filter.new(ingoing: true, outgoing: false, type: 'Alarm'),
    title: 'alarm'
  ))
end

Instance Method Details

#acceptable?(message) ⇒ Boolean

Returns:



12
13
14
15
16
17
18
# File 'lib/rsmp/collect/alarm_collector.rb', line 12

def acceptable?(message)
  return false if super == false
  return false unless fixed_attributes_match?(message)
  return false unless rvs_attributes_match?(message)

  true
end

#describe_matcherObject

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