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