Class: Flapjack::Gateways::Oobetet::Notifier
- Inherits:
-
Object
- Object
- Flapjack::Gateways::Oobetet::Notifier
- Defined in:
- lib/flapjack/gateways/oobetet.rb
Instance Attribute Summary collapse
-
#siblings ⇒ Object
Returns the value of attribute siblings.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Notifier
constructor
A new instance of Notifier.
- #start ⇒ Object
- #stop_type ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Notifier
Returns a new instance of Notifier.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/flapjack/gateways/oobetet.rb', line 24 def initialize( = {}) @lock = [:lock] @config = [:config] @hostname = Socket.gethostname unless @config['watched_check'] raise RuntimeError, 'Flapjack::Oobetet: watched_check must be defined in the config' end @check_matcher = '"' + @config['watched_check'] + '"' @flapjack_ok = true @last_alert = nil @last_breach = nil end |
Instance Attribute Details
#siblings ⇒ Object
Returns the value of attribute siblings.
22 23 24 |
# File 'lib/flapjack/gateways/oobetet.rb', line 22 def siblings @siblings end |
Instance Method Details
#start ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'lib/flapjack/gateways/oobetet.rb', line 40 def start loop do @lock.synchronize do check_timers end Kernel.sleep 10 end end |
#stop_type ⇒ Object
50 51 52 |
# File 'lib/flapjack/gateways/oobetet.rb', line 50 def stop_type :exception end |