module Transitions::ClassMethods

Public Instance Methods

get_state_machine() click to toggle source

rubocop:disable Style/AccessorMethodName

# File lib/transitions.rb, line 32
def get_state_machine
  @state_machine
end
inherited(klass) click to toggle source
Calls superclass method
# 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) click to toggle source
# File lib/transitions.rb, line 26
def state_machine(options = {}, &block)
  @state_machine ||= Machine.new self
  block ? @state_machine.update(options, &block) : @state_machine
end
state_machine=(value) click to toggle source

The only reason we need this method is for the inherited callback.

# File lib/transitions.rb, line 22
def state_machine=(value)
  @state_machine = value.dup
end