lib/finity/event.rb
# Handle the current state and execute the first allowed transition.
Handle the current state and execute the first allowed transition.
Handle the current state and execute the first allowed transition .
def handle object, state
      raise InvalidState, "No match for (:#{state.name}) on (:#{name})" unless
        @transitions.key? state.name
      @transitions[state.name].find do |transition|
        name = transition.handle object
        return name unless name.nil?
      end
    end
def handle object , state raise InvalidState , "No match for (:#{state.name}) on (:#{name})" unless @transitions . key? state . name @transitions [ state . name ] . find do | transition | name = transition . handle object return name unless name . nil? end end
Handle the current state and execute the first allowed transition.
Handle the current state and execute the first allowed transition .
object
<not_specific>
state
<not_specific>