Class: Hifsm::DSL::StateBuilder
- Inherits:
-
AbstractBuilder
- Object
- AbstractBuilder
- Hifsm::DSL::StateBuilder
- Defined in:
- lib/hifsm/dsl/state_builder.rb
Overview
Normalizes state definitions
Instance Method Summary collapse
- #event(*args, &block) ⇒ Object
-
#initialize(options = {}, &block) ⇒ StateBuilder
constructor
A new instance of StateBuilder.
- #state(*args, &block) ⇒ Object
Methods inherited from AbstractBuilder
Constructor Details
#initialize(options = {}, &block) ⇒ StateBuilder
Returns a new instance of StateBuilder.
6 7 8 9 10 |
# File 'lib/hifsm/dsl/state_builder.rb', line 6 def initialize( = {}, &block) super() build_def() instance_eval(&block) if block end |
Instance Method Details
#event(*args, &block) ⇒ Object
20 21 22 |
# File 'lib/hifsm/dsl/state_builder.rb', line 20 def event(*args, &block) defs.first[:sub_events].push [args, block] end |
#state(*args, &block) ⇒ Object
16 17 18 |
# File 'lib/hifsm/dsl/state_builder.rb', line 16 def state(*args, &block) defs.first[:sub_states].push [args, block] end |