Class: Workflow::Event::Transition Private
- Inherits:
-
Object
- Object
- Workflow::Event::Transition
- Defined in:
- lib/workflow/event.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents a possible transition via the event on which it is defined.
Instance Attribute Summary collapse
-
#target_state ⇒ Workflow::State
The target state for this transition.
Instance Method Summary collapse
-
#initialize(target_state, conditions_def, &block) ⇒ Transition
constructor
private
A new instance of Transition.
- #inspect ⇒ Object private
-
#matches?(target) ⇒ Boolean
private
Whether or not the conditions match for the target object.
Constructor Details
#initialize(target_state, conditions_def, &block) ⇒ Transition
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Transition.
103 104 105 106 |
# File 'lib/workflow/event.rb', line 103 def initialize(target_state, conditions_def, &block) @target_state = target_state @conditions = Conditions.new conditions_def, &block end |
Instance Attribute Details
#target_state ⇒ Workflow::State
Returns The target state for this transition.
91 92 93 |
# File 'lib/workflow/event.rb', line 91 def target_state @target_state end |
Instance Method Details
#inspect ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
108 109 110 |
# File 'lib/workflow/event.rb', line 108 def inspect "<to=#{target_state.inspect} conditions=#{conditions.inspect}" end |
#matches?(target) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Whether or not the conditions match for the target object.
97 98 99 |
# File 'lib/workflow/event.rb', line 97 def matches?(target) conditions.apply?(target) end |