public function respondTo($responses)
    {
        $format = $this->request()->format();
        
        foreach ($responses as $fmt => $action) {
            if (is_int($fmt)) {
                $fmt = $action;
                $action = null;
            }
            
            if ($fmt !== $format)
                continue;
            
            if ($action) {
                if (!$action instanceof Closure) {
                    throw new Exception\InvalidArgumentException(sprinft('Only closure can be passed to respondTo, %s passed', gettype($action)));
                }
                $action();
            } else {
                $action = true;
            }
            
            $this->_respond_action = $action;
            return;
        }
        
        /**
         * The request format is not acceptable.
         * Set to render nothing with 406 status.
         */
        Rails::log()->message("406 Not Acceptable");
        $this->render(array('nothing' => true), array('status' => 406));
    }