Module: Stateful::ClassMethods
- Defined in:
- lib/Stateful/ClassMethods.rb
Instance Method Summary collapse
- #final_state(*state_names) ⇒ Object
-
#final_state? ⇒ Boolean
(also: #has_final_state?)
predicate methods.
- #final_states(*state_names) ⇒ Object
- #initial_state(state_name = nil, options = {}, &block) ⇒ Object
- #state(state_name, options = {}, &block) ⇒ Object
-
#stateful(options = {}, &block) ⇒ Object
start DSL.
- #stateful_states ⇒ Object
Instance Method Details
#final_state(*state_names) ⇒ Object
27 28 29 |
# File 'lib/Stateful/ClassMethods.rb', line 27 def final_state(*state_names) stateful_states.final_state(*state_names) end |
#final_state? ⇒ Boolean Also known as: has_final_state?
predicate methods
39 40 41 |
# File 'lib/Stateful/ClassMethods.rb', line 39 def final_state? !final_states.empty? end |
#final_states(*state_names) ⇒ Object
31 32 33 |
# File 'lib/Stateful/ClassMethods.rb', line 31 def final_states(*state_names) stateful_states.final_states(*state_names) end |
#initial_state(state_name = nil, options = {}, &block) ⇒ Object
19 20 21 |
# File 'lib/Stateful/ClassMethods.rb', line 19 def initial_state(state_name = nil, = {}, &block) stateful_states.initial_state(state_name, , &block) end |
#state(state_name, options = {}, &block) ⇒ Object
23 24 25 |
# File 'lib/Stateful/ClassMethods.rb', line 23 def state(state_name, = {}, &block) stateful_states.state(state_name, , &block) end |
#stateful(options = {}, &block) ⇒ Object
start DSL
15 16 17 |
# File 'lib/Stateful/ClassMethods.rb', line 15 def stateful( = {}, &block) stateful_states.stateful(, &block) end |