Module: Transitions::ClassMethods
- Includes:
- Presenter
- Defined in:
- lib/transitions.rb
Instance Method Summary collapse
-
#get_state_machine ⇒ Object
rubocop:disable Style/AccessorMethodName.
- #inherited(klass) ⇒ Object
- #state_machine(options = {}, &block) ⇒ Object
-
#state_machine=(value) ⇒ Object
The only reason we need this method is for the inherited callback.
Methods included from Presenter
#available_events, #available_states
Instance Method Details
#get_state_machine ⇒ Object
rubocop:disable Style/AccessorMethodName
32 33 34 |
# File 'lib/transitions.rb', line 32 def get_state_machine @state_machine end |
#inherited(klass) ⇒ Object
16 17 18 19 |
# File 'lib/transitions.rb', line 16 def inherited(klass) super # Make sure we call other callbacks possibly defined upstream the ancestor chain. klass.state_machine = state_machine end |
#state_machine(options = {}, &block) ⇒ Object
26 27 28 29 |
# File 'lib/transitions.rb', line 26 def state_machine( = {}, &block) @state_machine ||= Machine.new self block ? @state_machine.update(, &block) : @state_machine end |
#state_machine=(value) ⇒ Object
The only reason we need this method is for the inherited callback.
22 23 24 |
# File 'lib/transitions.rb', line 22 def state_machine=(value) @state_machine = value.dup end |