Module | StateMachine::ClassMethods |
In: |
lib/state_machine/extensions.rb
|
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, line 19 19: def state_machines 20: @state_machines ||= superclass.state_machines.dup 21: end