lib/state_machine/transition.rb in state_machine-0.9.3 vs lib/state_machine/transition.rb in state_machine-0.9.4
- old
+ new
@@ -148,11 +148,13 @@
# end
# end
#
# vehicle = Vehicle.new
# transition = StateMachine::Transition.new(vehicle, machine, :ignite, :parked, :idling)
- # transition.perform # => Runs the +save+ action after setting the state attribute
- # transition.perform(false) # => Only sets the state attribute
+ # transition.perform # => Runs the +save+ action after setting the state attribute
+ # transition.perform(false) # => Only sets the state attribute
+ # transition.perform(Time.now) # => Passes in additional arguments and runs the +save+ action
+ # transition.perform(Time.now, false) # => Passes in additional arguments and only sets the state attribute
def perform(*args)
run_action = [true, false].include?(args.last) ? args.pop : true
self.args = args
# Run the transition