Class: RSMP::Alarm

Inherits:
Message show all
Defined in:
lib/rsmp/message.rb

Instance Attribute Summary

Attributes inherited from Message

#attributes, #direction, #json, #now, #out, #timestamp

Instance Method Summary collapse

Methods inherited from Message

#attribute, bin_to_chars, build, build_alarm, #ensure_message_id, #generate_json, #m_id, #m_id_short, make_m_id, parse_attributes, shorten_m_id, #type, #valid?, #validate, #validate_id, validate_message_type, #validate_type

Methods included from Inspect

#inspect, #inspector

Constructor Details

#initialize(attributes = {}) ⇒ Alarm

Returns a new instance of Alarm.



214
215
216
217
218
219
220
221
222
# File 'lib/rsmp/message.rb', line 214

def initialize attributes = {}
  super({
    "type" => "Alarm",
    "ntsOId" => '',
    "xNId" => '',
    "xACId" => '',
    "xNACId" => ''
  }.merge attributes)
end

Instance Method Details

#differ?(from) ⇒ Boolean

Returns:

  • (Boolean)


224
225
226
227
228
229
230
# File 'lib/rsmp/message.rb', line 224

def differ? from
  %w{aSp aCId ack aS sS aTs cat pri}.each do |key|
    return true if attribute(key).downcase != from.attribute(key).downcase
  end
  return true if attribute('rvs') != from.attribute('rvs')
  false
end