Class: RSMP::Alarm
Direct Known Subclasses
AlarmAcknowledge, AlarmAcknowledged, AlarmIssue, AlarmRequest, AlarmResume, AlarmResumed, AlarmSuspend, AlarmSuspended
Instance Attribute Summary
Attributes inherited from Message
#attributes, #direction, #json, #now, #out, #timestamp
Instance Method Summary collapse
- #differ?(from) ⇒ Boolean
-
#initialize(attributes = {}) ⇒ Alarm
constructor
A new instance of Alarm.
Methods inherited from Message
#attribute, bin_to_chars, build, build_alarm, create_message_instance, #ensure_message_id, #generate_json, #m_id, #m_id_short, make_m_id, message_types, parse_attributes, shorten_m_id, #type, #valid?, #validate, validate_attributes_structure, #validate_id?, validate_message_type, validate_mtype_field, #validate_type?, validate_type_field
Methods included from Inspect
Constructor Details
#initialize(attributes = {}) ⇒ Alarm
Returns a new instance of Alarm.
236 237 238 239 240 241 242 243 244 |
# File 'lib/rsmp/message.rb', line 236 def initialize(attributes = {}) super({ 'type' => 'Alarm', 'ntsOId' => '', 'xNId' => '', 'xACId' => '', 'xNACId' => '' }.merge attributes) end |
Instance Method Details
#differ?(from) ⇒ Boolean
246 247 248 249 250 251 252 253 |
# File 'lib/rsmp/message.rb', line 246 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 |