# File lib/state_machine/state.rb, line 181
    def context(&block)
      owner_class = machine.owner_class
      machine_name = machine.name
      name = self.name
      
      # Evaluate the method definitions
      context = ConditionProxy.new(owner_class, lambda {|object| object.class.state_machine(machine_name).states.matches?(object, name)})
      context.class_eval(&block)
      context.instance_methods.each do |method|
        methods[method.to_sym] = context.instance_method(method)
        
        # Calls the method defined by the current state of the machine
        context.class_eval "def \#{method}(*args, &block)\nself.class.state_machine(\#{machine_name.inspect}).states.match!(self).call(self, \#{method.inspect}, lambda {super}, *args, &block)\nend\n", __FILE__, __LINE__ + 1
      end
      
      # Include the context so that it can be bound to the owner class (the
      # context is considered an ancestor, so it's allowed to be bound)
      owner_class.class_eval { include context }
      
      context
    end