Class: AASM::Base

Inherits:
Object show all
Defined in:
lib/opal/aasm.rb

Overview

redefine the initialize method because it was was doing a very expensive (for Opal) class_eval with a string (instead of a block). While we are redefining this the unnecessary options have been removed.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, options = {}, &block) ⇒ Base

Returns a new instance of Base.



118
119
120
121
122
123
124
125
126
# File 'lib/opal/aasm.rb', line 118

def initialize(klass, options={}, &block)
  @klass = klass
  @state_machine = AASM::StateMachine[@klass]
  @options = options

  # let's cry if the transition is invalid
  configure :whiny_transitions, true
  
end

Instance Attribute Details

#state_machineObject (readonly)

Returns the value of attribute state_machine.



116
117
118
# File 'lib/opal/aasm.rb', line 116

def state_machine
  @state_machine
end