Methods
A
Classes and Modules
Instance Public methods
aasm_current_state()

Instance methods

# File lib/aasm/aasm.rb, line 75
  def aasm_current_state
    return @aasm_current_state if @aasm_current_state

    if self.respond_to?(:aasm_read_state) || self.private_methods.include?('aasm_read_state')
      @aasm_current_state = aasm_read_state
    end
    return @aasm_current_state if @aasm_current_state

    aasm_enter_initial_state
  end
aasm_enter_initial_state()
# File lib/aasm/aasm.rb, line 86
  def aasm_enter_initial_state
    state_name = aasm_determine_state_name(self.class.aasm_initial_state)
    state = aasm_state_object_for_state(state_name)

    state.call_action(:before_enter, self)
    state.call_action(:enter, self)
    self.aasm_current_state = state_name
    state.call_action(:after_enter, self)

    state_name
  end
aasm_events_for_current_state()
# File lib/aasm/aasm.rb, line 98
  def aasm_events_for_current_state
    aasm_events_for_state(aasm_current_state)
  end
aasm_events_for_state(state)
# File lib/aasm/aasm.rb, line 102
  def aasm_events_for_state(state)
    events = self.class.aasm_events.values.select {|event| event.transitions_from_state?(state) }
    events.map {|event| event.name}
  end