Class: Workflow::Event::Transition
- Inherits:
-
Object
- Object
- Workflow::Event::Transition
- Defined in:
- lib/workflow/event.rb
Instance Attribute Summary collapse
-
#conditions ⇒ Object
Returns the value of attribute conditions.
-
#target_state ⇒ Object
Returns the value of attribute target_state.
Instance Method Summary collapse
- #apply?(target) ⇒ Boolean
-
#initialize(target_state, conditions_def, &block) ⇒ Transition
constructor
delegate :apply?, to: :conditions.
- #inspect ⇒ Object
Constructor Details
#initialize(target_state, conditions_def, &block) ⇒ Transition
delegate :apply?, to: :conditions
36 37 38 39 |
# File 'lib/workflow/event.rb', line 36 def initialize(target_state, conditions_def, &block) @target_state = target_state @conditions = Conditions.new conditions_def, &block end |
Instance Attribute Details
#conditions ⇒ Object
Returns the value of attribute conditions.
31 32 33 |
# File 'lib/workflow/event.rb', line 31 def conditions @conditions end |
#target_state ⇒ Object
Returns the value of attribute target_state.
31 32 33 |
# File 'lib/workflow/event.rb', line 31 def target_state @target_state end |
Instance Method Details
#apply?(target) ⇒ Boolean
32 33 34 |
# File 'lib/workflow/event.rb', line 32 def apply?(target) conditions.apply?(target) end |
#inspect ⇒ Object
41 42 43 |
# File 'lib/workflow/event.rb', line 41 def inspect "<to=#{target_state.inspect} conditions=#{conditions.inspect}" end |