Module: SimplyFSM::ClassMethods
- Defined in:
- lib/simply_fsm/simply_fsm.rb
Overview
Defines the constructor for defining a state machine
Instance Method Summary collapse
-
#state_machine(name, opts = {}, &block) ⇒ Object
Declare a state machine called
name
which can then be defined by a DSL defined by the methods of StateMachine.
Instance Method Details
#state_machine(name, opts = {}, &block) ⇒ Object
Declare a state machine called name
which can then be defined by a DSL defined by the methods of StateMachine.
24 25 26 27 |
# File 'lib/simply_fsm/simply_fsm.rb', line 24 def state_machine(name, opts = {}, &block) fsm = StateMachine.new(name, self, fail: opts[:fail]) fsm.instance_eval(&block) end |