Class: Eye::Trigger::Flapping

Inherits:
Eye::Trigger show all
Defined in:
lib/eye/trigger/flapping.rb

Constant Summary

Constants inherited from Eye::Trigger

TYPES

Instance Attribute Summary

Attributes inherited from Eye::Trigger

#message, #options, #process

Instance Method Summary collapse

Methods inherited from Eye::Trigger

create, #defer, #exec_proc, #filter_transition, get_class, #inspect, #logger_sub_tag, #logger_tag, name_and_class, #notify, register, requires, #run_in_process_context, validate!

Methods included from Dsl::Validation

included

Constructor Details

#initialize(*args) ⇒ Flapping

Returns a new instance of Flapping.


11
12
13
14
# File 'lib/eye/trigger/flapping.rb', line 11

def initialize(*args)
  super
  @flapping_times = 0
end

Instance Method Details

#check(transition) ⇒ Object


16
17
18
# File 'lib/eye/trigger/flapping.rb', line 16

def check(transition)
  on_flapping if transition.event == :crashed && !good?
end