def call(object, method, *args, &block)
      options = args.last.is_a?(Hash) ? args.pop : {}
      options = {:method_name => method}.merge(options)
      state = machine.states.match!(object)

      if state == self && object.respond_to?(method)
        object.send(method, *args, &block)
      elsif method_missing = options[:method_missing]
        # Dispatch to the superclass since the object either isn't in this state
        # or this state doesn't handle the method
        begin
          method_missing.call
        rescue NoMethodError => ex
          if ex.name.to_s == options[:method_name].to_s && ex.args == args
            # No valid context for this method
            raise InvalidContext.new(object, "State #{state.name.inspect} for #{machine.name.inspect} is not a valid context for calling ##{options[:method_name]}")
          else
            raise
          end
        end
      end
    end
def call(object, method, *args, &block)
      options = args.last.is_a?(Hash) ? args.pop : {}
      options = {:method_name => method}.merge(options)
      state = machine.states.match!(object)

      if state == self && object.respond_to?(method)
        object.send(method, *args, &block)
      elsif method_missing = options[:method_missing]
        # Dispatch to the superclass since the object either isn't in this state
        # or this state doesn't handle the method
        begin
          method_missing.call
        rescue NoMethodError => ex
          if ex.name.to_s == options[:method_name].to_s && ex.args == args
            # No valid context for this method
            raise InvalidContext.new(object, "State #{state.name.inspect} for #{machine.name.inspect} is not a valid context for calling ##{options[:method_name]}")
          else
            raise
          end
        end
      end
    end
Calls a method defined in this state's context on the given object.  All
 arguments and any block will be passed into the method defined.

 If the method has never been defined for this state, then a NoMethodError
 will be raised.