Exception: AASM::InvalidTransition

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/aasm/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, event_name, state_machine_name) ⇒ InvalidTransition

Returns a new instance of InvalidTransition.



8
9
10
# File 'lib/aasm/errors.rb', line 8

def initialize(object, event_name, state_machine_name)
  @object, @event_name, @state_machine_name = object, event_name, state_machine_name
end

Instance Attribute Details

#event_nameObject (readonly)

Returns the value of attribute event_name.



6
7
8
# File 'lib/aasm/errors.rb', line 6

def event_name
  @event_name
end

#objectObject (readonly)

Returns the value of attribute object.



6
7
8
# File 'lib/aasm/errors.rb', line 6

def object
  @object
end

#state_machine_nameObject (readonly)

Returns the value of attribute state_machine_name.



6
7
8
# File 'lib/aasm/errors.rb', line 6

def state_machine_name
  @state_machine_name
end

Instance Method Details

#messageObject



12
13
14
# File 'lib/aasm/errors.rb', line 12

def message
  "Event '#{event_name}' cannot transition from '#{object.aasm(state_machine_name).current_state}'"
end