public function rest($pattern, $action) { self::$rules[self::REST_ROUTE . self::patternFactory($pattern)] = $action; return $this; }