Class: Finite::Transition
- Inherits:
-
Object
- Object
- Finite::Transition
- Defined in:
- lib/finite/transition.rb
Overview
The transition class. Represents a transition between two states
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Does this transition equal another transition?.
-
#initialize(opts) ⇒ Transition
constructor
Create a new transition object.
Constructor Details
#initialize(opts) ⇒ Transition
Create a new transition object
11 12 13 14 |
# File 'lib/finite/transition.rb', line 11 def initialize(opts) @from = opts[:from] @to = opts[:to] end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
6 7 8 |
# File 'lib/finite/transition.rb', line 6 def from @from end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
6 7 8 |
# File 'lib/finite/transition.rb', line 6 def to @to end |
Instance Method Details
#==(other) ⇒ Object
Does this transition equal another transition?
20 21 22 |
# File 'lib/finite/transition.rb', line 20 def ==(other) from == other.from and to == other.to end |