Class: LS4::FaultDetector::Term
- Inherits:
-
Object
- Object
- LS4::FaultDetector::Term
- Defined in:
- lib/ls4/logic/fault_detector.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #expired? ⇒ Boolean
- #forward_timer ⇒ Object
-
#initialize(value) ⇒ Term
constructor
A new instance of Term.
- #reset(value) ⇒ Object
Constructor Details
#initialize(value) ⇒ Term
Returns a new instance of Term.
93 94 95 |
# File 'lib/ls4/logic/fault_detector.rb', line 93 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
112 113 114 |
# File 'lib/ls4/logic/fault_detector.rb', line 112 def value @value end |
Instance Method Details
#expired? ⇒ Boolean
96 97 98 |
# File 'lib/ls4/logic/fault_detector.rb', line 96 def expired? @value <= 0 end |
#forward_timer ⇒ Object
99 100 101 102 103 104 105 106 107 108 |
# File 'lib/ls4/logic/fault_detector.rb', line 99 def forward_timer if @value > 0 @value -= 1 if @value == 0 return true end return false end return nil end |
#reset(value) ⇒ Object
109 110 111 |
# File 'lib/ls4/logic/fault_detector.rb', line 109 def reset(value) @value = value end |