Class: ComposableStateMachine::Machine
- Inherits:
-
MachineWithExternalState
- Object
- MachineWithExternalState
- ComposableStateMachine::Machine
- Defined in:
- lib/composable_state_machine/machine.rb
Overview
Machine with its own state.
Instance Attribute Summary collapse
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(model, options = {}) ⇒ Machine
constructor
Creates a machine.
Methods inherited from MachineWithExternalState
Constructor Details
#initialize(model, options = {}) ⇒ Machine
Creates a machine. Delegates to ComposableStateMachine::MachineWithExternalState#initialize passing method(:state) & method(:state=) as the state reader and writer.
10 11 12 |
# File 'lib/composable_state_machine/machine.rb', line 10 def initialize(model, = {}) super(model, method(:state), method(:state=), ) end |
Instance Attribute Details
#state ⇒ Object
Returns the value of attribute state.
7 8 9 |
# File 'lib/composable_state_machine/machine.rb', line 7 def state @state end |