class Asana::HttpClient::Response

Internal: Represents a response from the Asana API.

Attributes

body[R]

Public: Returns the [Hash] representing the parsed JSON body.

faraday_env[R]

Public: Returns a [Faraday::Env] object for debugging.

status[R]

Public: Returns the [Integer] status code of the response.

Public Class Methods

new(faraday_response) click to toggle source

Public: Wraps a Faraday response.

faraday_response - [Faraday::Response] the Faraday response to wrap.

# 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

Public Instance Methods

inspect()
Alias for: to_s
to_s() click to toggle source

Public: Returns a [String] representation of the response.

# File lib/asana/http_client/response.rb, line 26
def to_s
  "#<Asana::HttpClient::Response status=#{@status} body=#{@body}>"
end
Also aliased as: inspect