module StateMachine::ClassMethods

Public Instance Methods

state_machines() click to toggle source

Gets the current list of state machines defined for this class. This class-level attribute acts like an inheritable attribute. The attribute is available to each subclass, each having a copy of its superclass's attribute.

The hash of state machines maps :attribute => machine, e.g.

Vehicle.state_machines # => {:state => #<StateMachine::Machine:0xb6f6e4a4 ...>}
   # File lib/state_machine/extensions.rb
19 def state_machines
20   @state_machines ||= superclass.state_machines.dup
21 end