Class: Zara4::API::Communication::Grant::RefreshTokenGrant

Inherits:
GrantRequest
  • Object
show all
Defined in:
lib/zara4/api/communication/grant/refresh_token_grant.rb

Instance Attribute Summary collapse

Attributes inherited from GrantRequest

#client_id, #client_secret, #scopes

Instance Method Summary collapse

Methods inherited from GrantRequest

#get_tokens, #with_image_processing, #with_usage

Constructor Details

#initialize(client_id, client_secret, refresh_token, scopes) ⇒ RefreshTokenGrant

Returns a new instance of RefreshTokenGrant.



7
8
9
10
# File 'lib/zara4/api/communication/grant/refresh_token_grant.rb', line 7

def initialize(client_id, client_secret, refresh_token, scopes)
  super(client_id, client_secret, scopes)
  @refresh_token = refresh_token
end

Instance Attribute Details

#refresh_tokenObject

Returns the value of attribute refresh_token.



4
5
6
# File 'lib/zara4/api/communication/grant/refresh_token_grant.rb', line 4

def refresh_token
  @refresh_token
end

Instance Method Details

#dataObject

Data to be sent when fetching grant tokens.



24
25
26
27
# File 'lib/zara4/api/communication/grant/refresh_token_grant.rb', line 24

def data
  data = super.data()
  data['refresh_token'] = @refresh_token
end

#grant_typeObject

The type of this grant.



16
17
18
# File 'lib/zara4/api/communication/grant/refresh_token_grant.rb', line 16

def grant_type
  return 'refresh_token'
end