Class: HTTPigeon::Response
- Inherits:
-
Object
- Object
- HTTPigeon::Response
- Includes:
- Enumerable
- Defined in:
- lib/httpigeon/response.rb
Instance Attribute Summary collapse
-
#parsed_response ⇒ Object
readonly
Returns the value of attribute parsed_response.
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #[](key) ⇒ Object
-
#initialize(request, raw_response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(request, raw_response) ⇒ Response
Returns a new instance of Response.
10 11 12 13 14 15 |
# File 'lib/httpigeon/response.rb', line 10 def initialize(request, raw_response) @request = request @raw_response = raw_response parse_response end |
Instance Attribute Details
#parsed_response ⇒ Object (readonly)
Returns the value of attribute parsed_response.
5 6 7 |
# File 'lib/httpigeon/response.rb', line 5 def parsed_response @parsed_response end |
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
5 6 7 |
# File 'lib/httpigeon/response.rb', line 5 def raw_response @raw_response end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
5 6 7 |
# File 'lib/httpigeon/response.rb', line 5 def request @request end |
Instance Method Details
#==(other) ⇒ Object
17 18 19 |
# File 'lib/httpigeon/response.rb', line 17 def ==(other) other == parsed_response || other.to_json == to_json || super end |
#[](key) ⇒ Object
21 22 23 |
# File 'lib/httpigeon/response.rb', line 21 def [](key) parsed_response[key] end |