<?php
namespace phpr\http;
class Map
{
    private $rules = array();
    function __construct()
    {
    }

    public function getRules()
    {
        return $this->rules;
    }
    public function addRules($method , $pattern, $callback, $paramsOptional = array())
    {
        $rule = new Rule($method , $pattern, $callback, $paramsOptional);
        $this->rules[] = $rule;
    }
    public function get($pattern, $callback, $paramsOptional = array())
    {
        $this->addRules("GET",$pattern,$callback, $paramsOptional);
    }
    public function post($pattern, $callback)
    {
        $this->addRules("POST",$pattern,$callback);
    }
    public function put($pattern, $callback)
    {
        $this->addRules("PUT",$pattern,$callback);
    }
    public function delete($pattern, $callback)
    {
        $this->addRules("DELETE",$pattern,$callback);
    }
}
?>
