Class: RubyBreaker::Runtime::MonitorSwitch
- Inherits:
-
Object
- Object
- RubyBreaker::Runtime::MonitorSwitch
- Defined in:
- lib/rubybreaker/runtime/monitor.rb
Overview
This class is a switch to turn on and off the type monitoring system. It is important to turn off the monitor once the process is inside the monitor; otherwise, it WILL fall into an infinite loop.
Instance Attribute Summary collapse
-
#switch ⇒ Object
Returns the value of attribute switch.
Instance Method Summary collapse
-
#initialize ⇒ MonitorSwitch
constructor
A new instance of MonitorSwitch.
- #set_to(mode) ⇒ Object
- #turn_off ⇒ Object
- #turn_on ⇒ Object
Constructor Details
#initialize ⇒ MonitorSwitch
Returns a new instance of MonitorSwitch.
188 |
# File 'lib/rubybreaker/runtime/monitor.rb', line 188 def initialize(); @switch = true end |
Instance Attribute Details
#switch ⇒ Object
Returns the value of attribute switch.
186 187 188 |
# File 'lib/rubybreaker/runtime/monitor.rb', line 186 def switch @switch end |
Instance Method Details
#set_to(mode) ⇒ Object
200 |
# File 'lib/rubybreaker/runtime/monitor.rb', line 200 def set_to(mode); @switch = mode; end |
#turn_off ⇒ Object
195 196 197 198 |
# File 'lib/rubybreaker/runtime/monitor.rb', line 195 def turn_off(); RubyBreaker.log("Switch turned off") @switch = false; end |
#turn_on ⇒ Object
190 191 192 193 |
# File 'lib/rubybreaker/runtime/monitor.rb', line 190 def turn_on(); RubyBreaker.log("Switch turned on") @switch = true; end |