Class: Asana::HttpClient::Response Private
- Inherits:
-
Object
- Object
- Asana::HttpClient::Response
- Defined in:
- lib/asana/http_client/response.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents a response from the Asana API.
Instance Attribute Summary collapse
-
#body ⇒ Hash
readonly
Returns the Hash representing the parsed JSON body.
-
#faraday_env ⇒ Faraday::Env
readonly
Returns a Faraday::Env object for debugging.
-
#status ⇒ Integer
readonly
Returns the Integer status code of the response.
Instance Method Summary collapse
-
#initialize(faraday_response) ⇒ Response
constructor
Wraps a Faraday response.
-
#to_s ⇒ String
(also: #inspect)
Returns a String representation of the response.
Constructor Details
#initialize(faraday_response) ⇒ Response
Wraps a Faraday response.
18 19 20 21 22 |
# File 'lib/asana/http_client/response.rb', line 18 def initialize(faraday_response) @faraday_env = faraday_response.env @status = faraday_env.status @body = faraday_env.body end |
Instance Attribute Details
#body ⇒ Hash (readonly)
Returns the Hash representing the parsed JSON body.
13 14 15 |
# File 'lib/asana/http_client/response.rb', line 13 def body @body end |
#faraday_env ⇒ Faraday::Env (readonly)
Returns a Faraday::Env object for debugging.
7 8 9 |
# File 'lib/asana/http_client/response.rb', line 7 def faraday_env @faraday_env end |
#status ⇒ Integer (readonly)
Returns the Integer status code of the response.
10 11 12 |
# File 'lib/asana/http_client/response.rb', line 10 def status @status end |
Instance Method Details
#to_s ⇒ String Also known as: inspect
Returns a String representation of the response.
26 27 28 |
# File 'lib/asana/http_client/response.rb', line 26 def to_s "#<Asana::HttpClient::Response status=#{@status} body=#{@body}>" end |