Class: Usher::Node::FailedResponse
- Inherits:
-
Struct
- Object
- Struct
- Usher::Node::FailedResponse
- Defined in:
- lib/usher/node/failed_response.rb
Overview
The response from Root#lookup. Adds some convenience methods for common parameter manipulation.
Instance Attribute Summary collapse
-
#fail_sub_type ⇒ Object
Returns the value of attribute fail_sub_type.
-
#fail_type ⇒ Object
Returns the value of attribute fail_type.
-
#last_matching_node ⇒ Object
Returns the value of attribute last_matching_node.
Instance Method Summary collapse
- #acceptable_responses ⇒ Object
- #acceptable_responses_only_strings ⇒ Object
- #normal_or_greedy? ⇒ Boolean
- #request_method? ⇒ Boolean
-
#succeeded? ⇒ Boolean
The success of the response.
Instance Attribute Details
#fail_sub_type ⇒ Object
Returns the value of attribute fail_sub_type
4 5 6 |
# File 'lib/usher/node/failed_response.rb', line 4 def fail_sub_type @fail_sub_type end |
#fail_type ⇒ Object
Returns the value of attribute fail_type
4 5 6 |
# File 'lib/usher/node/failed_response.rb', line 4 def fail_type @fail_type end |
#last_matching_node ⇒ Object
Returns the value of attribute last_matching_node
4 5 6 |
# File 'lib/usher/node/failed_response.rb', line 4 def last_matching_node @last_matching_node end |
Instance Method Details
#acceptable_responses ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/usher/node/failed_response.rb', line 19 def acceptable_responses case fail_type when :request_method last_matching_node.request.keys when :normal_or_greedy (last_matching_node.greedy || []) + (last_matching_node.normal || []) end end |
#acceptable_responses_only_strings ⇒ Object
28 29 30 |
# File 'lib/usher/node/failed_response.rb', line 28 def acceptable_responses_only_strings acceptable_responses.select{|r| r.is_a?(String)} end |
#normal_or_greedy? ⇒ Boolean
15 16 17 |
# File 'lib/usher/node/failed_response.rb', line 15 def normal_or_greedy? fail_type == :normal_or_greedy end |
#request_method? ⇒ Boolean
11 12 13 |
# File 'lib/usher/node/failed_response.rb', line 11 def request_method? fail_type == :request_method end |
#succeeded? ⇒ Boolean
The success of the response
7 8 9 |
# File 'lib/usher/node/failed_response.rb', line 7 def succeeded? false end |