Class: Toaster::StateTransition
- Inherits:
-
Object
- Object
- Toaster::StateTransition
- Defined in:
- lib/toaster/state/state_transition.rb
Instance Attribute Summary collapse
-
#parameters ⇒ Object
Returns the value of attribute parameters.
-
#post_state ⇒ Object
Returns the value of attribute post_state.
-
#pre_state ⇒ Object
Returns the value of attribute pre_state.
Instance Method Summary collapse
- #==(obj) ⇒ Object
- #eql?(obj) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(pre_state = {}, parameters = {}, post_state = {}) ⇒ StateTransition
constructor
A new instance of StateTransition.
Constructor Details
#initialize(pre_state = {}, parameters = {}, post_state = {}) ⇒ StateTransition
Returns a new instance of StateTransition.
15 16 17 18 19 |
# File 'lib/toaster/state/state_transition.rb', line 15 def initialize(pre_state={}, parameters={}, post_state={}) @pre_state = pre_state @parameters = parameters @post_state = post_state end |
Instance Attribute Details
#parameters ⇒ Object
Returns the value of attribute parameters.
13 14 15 |
# File 'lib/toaster/state/state_transition.rb', line 13 def parameters @parameters end |
#post_state ⇒ Object
Returns the value of attribute post_state.
13 14 15 |
# File 'lib/toaster/state/state_transition.rb', line 13 def post_state @post_state end |
#pre_state ⇒ Object
Returns the value of attribute pre_state.
13 14 15 |
# File 'lib/toaster/state/state_transition.rb', line 13 def pre_state @pre_state end |
Instance Method Details
#==(obj) ⇒ Object
28 29 30 |
# File 'lib/toaster/state/state_transition.rb', line 28 def ==(obj) return eql?(obj) end |
#eql?(obj) ⇒ Boolean
21 22 23 24 25 26 |
# File 'lib/toaster/state/state_transition.rb', line 21 def eql?(obj) return false if !obj.kind_of?(StateTransition) return obj.pre_state.eql?(@pre_state) && obj.parameters.eql?(@parameters) && obj.post_state.eql?(@post_state) end |
#hash ⇒ Object
32 33 34 |
# File 'lib/toaster/state/state_transition.rb', line 32 def hash() return @pre_state.hash + @parameters.hash + @post_state.hash end |