Module: Opal::StateMachine::AASMAPI

Defined in:
lib/opal/aasm.rb

Instance Method Summary collapse

Instance Method Details

#state_machine_options(opts = {}) ⇒ Object

add the state_machine_options directive and the new :state_name option



66
67
68
69
70
71
72
# File 'lib/opal/aasm.rb', line 66

def state_machine_options(opts={})
  define_method(opts.delete(:state_name)) do 
    protected_current_react_state_var if respond_to? :render
    aasm.current_state.to_s
  end if opts[:state_name]
  aasm opts
end