Methods
#
E
F
N
P
Attributes
[R] from
[R] to
[R] opts
Class Public methods
new(opts)
# File lib/aasm/state_transition.rb, line 5
  def initialize(opts)
    @from, @to, @guard, @on_transition = opts[:from], opts[:to], opts[:guard], opts[:on_transition]
    @opts = opts
  end
Instance Public methods
==(obj)
# File lib/aasm/state_transition.rb, line 27
  def ==(obj)
    @from == obj.from && @to == obj.to
  end
execute(obj, *args)
# File lib/aasm/state_transition.rb, line 21
  def execute(obj, *args)
    @on_transition.is_a?(Array) ?
            @on_transition.each {|ot| _execute(obj, ot, *args)} :
            _execute(obj, @on_transition, *args)
  end
from?(value)
# File lib/aasm/state_transition.rb, line 31
  def from?(value)
    @from == value
  end
perform(obj)
# File lib/aasm/state_transition.rb, line 10
  def perform(obj)
    case @guard
      when Symbol, String
        obj.send(@guard)
      when Proc
        @guard.call(obj)
      else
        true
    end
  end