Class: SimpleState::Machine
- Inherits:
-
Object
- Object
- SimpleState::Machine
- Defined in:
- lib/simple_state/machine.rb
Instance Method Summary collapse
-
#initialize(object, state_attribute = :state, definition = nil, &block) ⇒ Machine
constructor
A new instance of Machine.
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 |