Class: ComposableStateMachine::Machine

Inherits:
MachineWithExternalState show all
Defined in:
lib/composable_state_machine/machine.rb

Overview

Machine with its own state.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from MachineWithExternalState

#==, #trigger

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, options = {})
  super(model, method(:state), method(:state=), options)
end

Instance Attribute Details

#stateObject

Returns the value of attribute state.



7
8
9
# File 'lib/composable_state_machine/machine.rb', line 7

def state
  @state
end