Class: HttpRouter::Route
- Inherits:
-
Object
- Object
- HttpRouter::Route
- Defined in:
- lib/http_router/route.rb
Constant Summary collapse
- VALID_HTTP_VERBS =
The list of HTTP request methods supported by HttpRouter.
%w{GET POST PUT DELETE HEAD OPTIONS TRACE PATCH OPTIONS LINK UNLINK}
- VALID_HTTP_VERBS_WITHOUT_GET =
VALID_HTTP_VERBS - %w{GET}
Instance Attribute Summary collapse
-
#default_values ⇒ Object
readonly
Returns the value of attribute default_values.
-
#dest ⇒ Object
Returns the value of attribute dest.
-
#generator ⇒ Object
Returns the value of attribute generator.
-
#host ⇒ Object
Returns the value of attribute host.
-
#ignore_trailing_slash ⇒ Object
Returns the value of attribute ignore_trailing_slash.
-
#match_partially ⇒ Object
Returns the value of attribute match_partially.
-
#name ⇒ Object
Returns the value of attribute name.
-
#original_path ⇒ Object
Returns the value of attribute original_path.
-
#other_hosts ⇒ Object
readonly
Returns the value of attribute other_hosts.
-
#path_for_generation ⇒ Object
Returns the value of attribute path_for_generation.
-
#path_validation_regex ⇒ Object
Returns the value of attribute path_validation_regex.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#request_methods ⇒ Object
readonly
Returns the value of attribute request_methods.
-
#router ⇒ Object
Returns the value of attribute router.
-
#scheme ⇒ Object
Returns the value of attribute scheme.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
Instance Attribute Details
#default_values ⇒ Object (readonly)
Returns the value of attribute default_values.
9 10 11 |
# File 'lib/http_router/route.rb', line 9 def default_values @default_values end |
#dest ⇒ Object
Returns the value of attribute dest.
10 11 12 |
# File 'lib/http_router/route.rb', line 10 def dest @dest end |
#generator ⇒ Object
Returns the value of attribute generator.
10 11 12 |
# File 'lib/http_router/route.rb', line 10 def generator @generator end |
#host ⇒ Object
Returns the value of attribute host.
10 11 12 |
# File 'lib/http_router/route.rb', line 10 def host @host end |
#ignore_trailing_slash ⇒ Object
Returns the value of attribute ignore_trailing_slash.
10 11 12 |
# File 'lib/http_router/route.rb', line 10 def ignore_trailing_slash @ignore_trailing_slash end |
#match_partially ⇒ Object
Returns the value of attribute match_partially.
9 10 11 |
# File 'lib/http_router/route.rb', line 9 def match_partially @match_partially end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/http_router/route.rb', line 9 def name @name end |
#original_path ⇒ Object
Returns the value of attribute original_path.
10 11 12 |
# File 'lib/http_router/route.rb', line 10 def original_path @original_path end |
#other_hosts ⇒ Object (readonly)
Returns the value of attribute other_hosts.
9 10 11 |
# File 'lib/http_router/route.rb', line 9 def other_hosts @other_hosts end |
#path_for_generation ⇒ Object
Returns the value of attribute path_for_generation.
10 11 12 |
# File 'lib/http_router/route.rb', line 10 def path_for_generation @path_for_generation end |
#path_validation_regex ⇒ Object
Returns the value of attribute path_validation_regex.
10 11 12 |
# File 'lib/http_router/route.rb', line 10 def path_validation_regex @path_validation_regex end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
9 10 11 |
# File 'lib/http_router/route.rb', line 9 def paths @paths end |
#request_methods ⇒ Object (readonly)
Returns the value of attribute request_methods.
9 10 11 |
# File 'lib/http_router/route.rb', line 9 def request_methods @request_methods end |
#router ⇒ Object
Returns the value of attribute router.
9 10 11 |
# File 'lib/http_router/route.rb', line 9 def router @router end |
#scheme ⇒ Object
Returns the value of attribute scheme.
10 11 12 |
# File 'lib/http_router/route.rb', line 10 def scheme @scheme end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
10 11 12 |
# File 'lib/http_router/route.rb', line 10 def user_agent @user_agent end |
Instance Method Details
#create_clone(new_router) ⇒ Object
13 14 15 16 17 |
# File 'lib/http_router/route.rb', line 13 def create_clone(new_router) r = clone r.dest = (begin; dest.clone; rescue; dest; end) r end |
#matches_with(var_name) ⇒ Object
23 24 25 |
# File 'lib/http_router/route.rb', line 23 def matches_with(var_name) @match_with && @match_with[:"#{var_name}"] end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/http_router/route.rb', line 19 def to_s "#<HttpRouter:Route #{object_id} @path_for_generation=#{path_for_generation.inspect}>" end |