Method: StateMachine::Event#fire
- Defined in:
- lib/state_machine/event.rb
#fire(object, *args) ⇒ Object
Attempts to perform the next available transition on the given object. If no transitions can be made, then this will return false, otherwise true.
Any additional arguments are passed to the StateMachine::Transition#perform instance method.
169 170 171 172 173 174 175 176 177 178 |
# File 'lib/state_machine/event.rb', line 169 def fire(object, *args) machine.reset(object) if transition = transition_for(object) transition.perform(*args) else on_failure(object) false end end |