Class: AmazonDrs::AccessToken

Inherits:
Base
  • Object
show all
Defined in:
lib/amazon-drs/access_token.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#date, #error_description_url, #error_type, #request_id, #status_code

Instance Method Summary collapse

Methods inherited from Base

#initialize, #inspect

Constructor Details

This class inherits a constructor from AmazonDrs::Base

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



5
6
7
# File 'lib/amazon-drs/access_token.rb', line 5

def access_token
  @access_token
end

#expires_inObject

Returns the value of attribute expires_in.



5
6
7
# File 'lib/amazon-drs/access_token.rb', line 5

def expires_in
  @expires_in
end

#refresh_tokenObject

Returns the value of attribute refresh_token.



5
6
7
# File 'lib/amazon-drs/access_token.rb', line 5

def refresh_token
  @refresh_token
end

#token_typeObject

Returns the value of attribute token_type.



5
6
7
# File 'lib/amazon-drs/access_token.rb', line 5

def token_type
  @token_type
end

Instance Method Details

#parse_body(body) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/amazon-drs/access_token.rb', line 7

def parse_body(body)
  json = JSON.parse(body)
  @access_token = json['access_token']
  @refresh_token = json['refresh_token']
  @token_type = json['token_type']
  @expires_in = json['expires_in']
end