Class: LS4::FaultDetector::Term

Inherits:
Object
  • Object
show all
Defined in:
lib/ls4/logic/fault_detector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Term



93
94
95
# File 'lib/ls4/logic/fault_detector.rb', line 93

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject

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_timerObject



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