Module: Stateflow::InstanceMethods
- Defined in:
- lib/stateflow.rb
Instance Attribute Summary collapse
-
#_previous_state ⇒ Object
Returns the value of attribute _previous_state.
Instance Method Summary collapse
Instance Attribute Details
#_previous_state ⇒ Object
Returns the value of attribute _previous_state.
42 43 44 |
# File 'lib/stateflow.rb', line 42 def _previous_state @_previous_state end |
Instance Method Details
#current_state ⇒ Object
44 45 46 |
# File 'lib/stateflow.rb', line 44 def current_state @current_state ||= load_from_persistence.nil? ? machine.initial_state : machine.states[load_from_persistence.to_sym] end |
#machine ⇒ Object
53 54 55 |
# File 'lib/stateflow.rb', line 53 def machine self.class.machine end |
#set_current_state(new_state, options = {}) ⇒ Object
48 49 50 51 |
# File 'lib/stateflow.rb', line 48 def set_current_state(new_state, = {}) save_to_persistence(new_state.name.to_s, ) @current_state = new_state end |