Class: APIConnector::Response
- Inherits:
-
Object
- Object
- APIConnector::Response
- Defined in:
- lib/track-r/api_connector/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(options = {}) ⇒ Response
constructor
A new instance of Response.
- #to_h ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Response
Returns a new instance of Response.
6 7 8 9 10 |
# File 'lib/track-r/api_connector/response.rb', line 6 def initialize(={}) @headers = [:headers] || nil @body = [:body] || nil @error_message = [:error_message] || nil end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/track-r/api_connector/response.rb', line 4 def body @body end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
4 5 6 |
# File 'lib/track-r/api_connector/response.rb', line 4 def @error_message end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
4 5 6 |
# File 'lib/track-r/api_connector/response.rb', line 4 def headers @headers end |
Instance Method Details
#error? ⇒ Boolean
16 17 18 |
# File 'lib/track-r/api_connector/response.rb', line 16 def error? @connection_error end |
#to_h ⇒ Object
12 13 14 |
# File 'lib/track-r/api_connector/response.rb', line 12 def to_h Hpricot(@body) end |