Class: IntuitOAuth::ClientResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/intuit-oauth/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ClientResponse

Returns a new instance of ClientResponse.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/intuit-oauth/response.rb', line 20

def initialize(response)
  @access_token = response['access_token']
  @expires_in = response['expires_in']
  @refresh_token = response['refresh_token']
  @x_refresh_token_expires_in = response['x_refresh_token_expires_in']
  if response['id_token']
    @id_token = response['id_token']
  end
  if response['realmId']
    @realm_id = response['realmId']
  end

  @headers = response.headers
  @body = response
  @code = response.code
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



17
18
19
# File 'lib/intuit-oauth/response.rb', line 17

def access_token
  @access_token
end

#bodyObject (readonly)

Returns the value of attribute body.



17
18
19
# File 'lib/intuit-oauth/response.rb', line 17

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



17
18
19
# File 'lib/intuit-oauth/response.rb', line 17

def code
  @code
end

#expires_inObject (readonly)

Returns the value of attribute expires_in.



17
18
19
# File 'lib/intuit-oauth/response.rb', line 17

def expires_in
  @expires_in
end

#headersObject (readonly)

Returns the value of attribute headers.



17
18
19
# File 'lib/intuit-oauth/response.rb', line 17

def headers
  @headers
end

#id_tokenObject (readonly)

Returns the value of attribute id_token.



17
18
19
# File 'lib/intuit-oauth/response.rb', line 17

def id_token
  @id_token
end

#realm_idObject (readonly)

Returns the value of attribute realm_id.



17
18
19
# File 'lib/intuit-oauth/response.rb', line 17

def realm_id
  @realm_id
end

#refresh_tokenObject (readonly)

Returns the value of attribute refresh_token.



17
18
19
# File 'lib/intuit-oauth/response.rb', line 17

def refresh_token
  @refresh_token
end

#x_refresh_token_expires_inObject (readonly)

Returns the value of attribute x_refresh_token_expires_in.



17
18
19
# File 'lib/intuit-oauth/response.rb', line 17

def x_refresh_token_expires_in
  @x_refresh_token_expires_in
end