Class: Usher::Node::Response
- Inherits:
-
Struct
- Object
- Struct
- Usher::Node::Response
- Defined in:
- lib/usher/node/response.rb
Instance Attribute Summary collapse
-
#matched_path ⇒ Object
Returns the value of attribute matched_path.
-
#only_trailing_delimiters ⇒ Object
Returns the value of attribute only_trailing_delimiters.
-
#params_as_array ⇒ Object
Returns the value of attribute params_as_array.
-
#path ⇒ Object
Returns the value of attribute path.
-
#remaining_path ⇒ Object
Returns the value of attribute remaining_path.
Instance Method Summary collapse
Instance Attribute Details
#matched_path ⇒ Object
Returns the value of attribute matched_path
3 4 5 |
# File 'lib/usher/node/response.rb', line 3 def matched_path @matched_path end |
#only_trailing_delimiters ⇒ Object
Returns the value of attribute only_trailing_delimiters.
5 6 7 |
# File 'lib/usher/node/response.rb', line 5 def only_trailing_delimiters @only_trailing_delimiters end |
#params_as_array ⇒ Object
Returns the value of attribute params_as_array
3 4 5 |
# File 'lib/usher/node/response.rb', line 3 def params_as_array @params_as_array end |
#path ⇒ Object
Returns the value of attribute path
3 4 5 |
# File 'lib/usher/node/response.rb', line 3 def path @path end |
#remaining_path ⇒ Object
Returns the value of attribute remaining_path
3 4 5 |
# File 'lib/usher/node/response.rb', line 3 def remaining_path @remaining_path end |
Instance Method Details
#destination ⇒ Object
19 20 21 |
# File 'lib/usher/node/response.rb', line 19 def destination path && path.route.destination end |
#params ⇒ Object
7 8 9 |
# File 'lib/usher/node/response.rb', line 7 def params @params ||= path.convert_params_array(params_as_array) end |
#params_as_hash ⇒ Object
15 16 17 |
# File 'lib/usher/node/response.rb', line 15 def params_as_hash @params_as_hash ||= params_as_array.inject({}){|hash, val| hash[path.dynamic_keys[hash.size]] = val; hash} end |
#partial_match? ⇒ Boolean
11 12 13 |
# File 'lib/usher/node/response.rb', line 11 def partial_match? !remaining_path.nil? end |