Class: StateFlow::ActionEvent
- Defined in:
- lib/state_flow/action_event.rb
Constant Summary collapse
- ELSE =
Object.new
Instance Attribute Summary collapse
-
#matcher ⇒ Object
readonly
Returns the value of attribute matcher.
Attributes inherited from Element
Instance Method Summary collapse
-
#initialize(origin, matcher, &block) ⇒ ActionEvent
constructor
A new instance of ActionEvent.
- #match?(action_result) ⇒ Boolean
Methods inherited from Event
Methods included from ExceptionHandlerClient
#exception_handlers, #exception_handling
Methods included from ActionClient
Methods included from GuardClient
#guard, #guard_else, #guard_for, #guards
Methods inherited from Element
#flow, #inspect, #retry_in_recovering, #state, #to, uninspected_var, uninspected_vars, #update_to_destination
Methods included from ElementVisitable
Constructor Details
#initialize(origin, matcher, &block) ⇒ ActionEvent
Returns a new instance of ActionEvent.
9 10 11 12 |
# File 'lib/state_flow/action_event.rb', line 9 def initialize(origin, matcher, &block) @matcher = matcher super(origin, &block) end |
Instance Attribute Details
#matcher ⇒ Object (readonly)
Returns the value of attribute matcher.
8 9 10 |
# File 'lib/state_flow/action_event.rb', line 8 def matcher @matcher end |
Instance Method Details
#match?(action_result) ⇒ Boolean
14 15 16 17 |
# File 'lib/state_flow/action_event.rb', line 14 def match?(action_result) return true if matcher == ActionEvent::ELSE matcher === action_result end |