Class: Aspera::OAuth::Generic
Overview
Generic token creator
Instance Method Summary collapse
- #create_token ⇒ Object
-
#initialize(grant_type:, response_type: nil, apikey: nil, receiver_client_ids: nil, **base_params) ⇒ Generic
constructor
A new instance of Generic.
Methods inherited from Base
#create_token_call, #optional_scope_client_id, #scope=, #token
Constructor Details
#initialize(grant_type:, response_type: nil, apikey: nil, receiver_client_ids: nil, **base_params) ⇒ Generic
Returns a new instance of Generic.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/aspera/oauth/generic.rb', line 9 def initialize( grant_type:, response_type: nil, apikey: nil, receiver_client_ids: nil, **base_params ) super(**base_params, cache_ids: [grant_type&.split(':')&.last, apikey, response_type]) @create_params = { grant_type: grant_type } @create_params[:response_type] = response_type unless response_type.nil? @create_params[:apikey] = apikey unless apikey.nil? @create_params[:receiver_client_ids] = receiver_client_ids unless receiver_client_ids.nil? end |
Instance Method Details
#create_token ⇒ Object
25 26 27 |
# File 'lib/aspera/oauth/generic.rb', line 25 def create_token return create_token_call(optional_scope_client_id.merge(@create_params)) end |