Class: Mutator::Transition
- Inherits:
-
Object
- Object
- Mutator::Transition
- Defined in:
- lib/mutator/transition.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#machine ⇒ Object
readonly
Returns the value of attribute machine.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(to:, from:, machine:) ⇒ Transition
constructor
A new instance of Transition.
- #stateholder ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(to:, from:, machine:) ⇒ Transition
Returns a new instance of Transition.
5 6 7 |
# File 'lib/mutator/transition.rb', line 5 def initialize(to:, from:, machine:) @to, @from, @machine = to, from, machine end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
3 4 5 |
# File 'lib/mutator/transition.rb', line 3 def from @from end |
#machine ⇒ Object (readonly)
Returns the value of attribute machine.
3 4 5 |
# File 'lib/mutator/transition.rb', line 3 def machine @machine end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
3 4 5 |
# File 'lib/mutator/transition.rb', line 3 def to @to end |
Instance Method Details
#stateholder ⇒ Object
13 14 15 |
# File 'lib/mutator/transition.rb', line 13 def stateholder machine.stateholder end |
#valid? ⇒ Boolean
9 10 11 |
# File 'lib/mutator/transition.rb', line 9 def valid? transitions.present? end |