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