Class: RSMP::AlarmState
- Inherits:
-
Object
- Object
- RSMP::AlarmState
- Defined in:
- lib/rsmp/alarm_state.rb
Overview
class that tracks the state of an alarm
Instance Attribute Summary collapse
-
#acknowledged ⇒ Object
readonly
Returns the value of attribute acknowledged.
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#component_id ⇒ Object
readonly
Returns the value of attribute component_id.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
-
#suspended ⇒ Object
readonly
Returns the value of attribute suspended.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(component_id:, code:) ⇒ AlarmState
constructor
A new instance of AlarmState.
- #resume ⇒ Object
- #suspend ⇒ Object
Constructor Details
#initialize(component_id:, code:) ⇒ AlarmState
Returns a new instance of AlarmState.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/rsmp/alarm_state.rb', line 6 def initialize component_id:, code: @component_id = component_id @code = code @acknowledged = false @suspended = false @active = false @timestamp = nil @category = nil @priority = nil end |
Instance Attribute Details
#acknowledged ⇒ Object (readonly)
Returns the value of attribute acknowledged.
4 5 6 |
# File 'lib/rsmp/alarm_state.rb', line 4 def acknowledged @acknowledged end |
#active ⇒ Object (readonly)
Returns the value of attribute active.
4 5 6 |
# File 'lib/rsmp/alarm_state.rb', line 4 def active @active end |
#category ⇒ Object (readonly)
Returns the value of attribute category.
4 5 6 |
# File 'lib/rsmp/alarm_state.rb', line 4 def category @category end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/rsmp/alarm_state.rb', line 4 def code @code end |
#component_id ⇒ Object (readonly)
Returns the value of attribute component_id.
4 5 6 |
# File 'lib/rsmp/alarm_state.rb', line 4 def component_id @component_id end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
4 5 6 |
# File 'lib/rsmp/alarm_state.rb', line 4 def priority @priority end |
#suspended ⇒ Object (readonly)
Returns the value of attribute suspended.
4 5 6 |
# File 'lib/rsmp/alarm_state.rb', line 4 def suspended @suspended end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
4 5 6 |
# File 'lib/rsmp/alarm_state.rb', line 4 def @timestamp end |
Instance Method Details
#resume ⇒ Object
21 22 23 |
# File 'lib/rsmp/alarm_state.rb', line 21 def resume @suspended = false end |
#suspend ⇒ Object
17 18 19 |
# File 'lib/rsmp/alarm_state.rb', line 17 def suspend @suspended = true end |