Class: SimpleState::Machine

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_state/machine.rb

Instance Method Summary collapse

Constructor Details

#initialize(object, state_attribute = :state, definition = nil, &block) ⇒ Machine

Returns a new instance of Machine.



3
4
5
6
7
8
9
# File 'lib/simple_state/machine.rb', line 3

def initialize(object, state_attribute = :state, definition = nil, &block)
  @object          = object
  @state_attribute = state_attribute
  @definition      = definition || SimpleState::Definition.define(&block)

  define_trasition_methods
end