Class: Zara4::API::Communication::AccessToken::RefreshableAccessToken
- Inherits:
-
AccessToken
- Object
- AccessToken
- Zara4::API::Communication::AccessToken::RefreshableAccessToken
- Defined in:
- lib/zara4/api/communication/access_token/refreshable_access_token.rb
Instance Attribute Summary collapse
-
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
Attributes inherited from AccessToken
#access_token, #client_id, #client_secret, #expires_at
Instance Method Summary collapse
-
#initialize(client_id, client_secret, access_token, expires_at, refesh_token) ⇒ RefreshableAccessToken
constructor
Constructor.
-
#refresh ⇒ Object
Refresh this ReissuableAccessToken.
Methods inherited from AccessToken
Constructor Details
#initialize(client_id, client_secret, access_token, expires_at, refesh_token) ⇒ RefreshableAccessToken
Constructor
10 11 12 13 |
# File 'lib/zara4/api/communication/access_token/refreshable_access_token.rb', line 10 def initialize(client_id, client_secret, access_token, expires_at, refesh_token) super(client_id, client_secret, access_token, expires_at) @refresh_token = refresh_token end |
Instance Attribute Details
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
4 5 6 |
# File 'lib/zara4/api/communication/access_token/refreshable_access_token.rb', line 4 def refresh_token @refresh_token end |
Instance Method Details
#refresh ⇒ Object
Refresh this ReissuableAccessToken
19 20 21 22 23 24 25 26 |
# File 'lib/zara4/api/communication/access_token/refreshable_access_token.rb', line 19 def refresh grant = RefreshTokenGrant.new(@client_id, @client_secret, @refresh_token, []) tokens = grant.get_tokens() @access_token = tokens['access_tokens'] @expires_at = '' @refresh_token = tokens['refresh_token'] end |