Class: Quickbooks::Service::Responses::OAuth2HttpResponse

Inherits:
Object
  • Object
show all
Includes:
Methods
Defined in:
lib/quickbooks/service/responses/oauth2_http_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ OAuth2HttpResponse

response : Faraday response



11
12
13
# File 'lib/quickbooks/service/responses/oauth2_http_response.rb', line 11

def initialize(response)
  @real_response = response
end

Instance Attribute Details

#real_responseObject

Returns the value of attribute real_response.



8
9
10
# File 'lib/quickbooks/service/responses/oauth2_http_response.rb', line 8

def real_response
  @real_response
end

Instance Method Details

#bodyObject



19
20
21
# File 'lib/quickbooks/service/responses/oauth2_http_response.rb', line 19

def body
  @real_response.body
end

#codeObject



27
28
29
# File 'lib/quickbooks/service/responses/oauth2_http_response.rb', line 27

def code
  @real_response.status.to_i
end

#headersObject



31
32
33
34
35
36
37
# File 'lib/quickbooks/service/responses/oauth2_http_response.rb', line 31

def headers
  if @real_response.respond_to?(:headers)
    @real_response.headers
  else
    nil
  end
end

#plain_bodyObject



23
24
25
# File 'lib/quickbooks/service/responses/oauth2_http_response.rb', line 23

def plain_body
  body
end

#versionObject



15
16
17
# File 'lib/quickbooks/service/responses/oauth2_http_response.rb', line 15

def version
  2
end