Module: PayPal::SDK::Core::OpenIDConnect::RequestDataType

Extended by:
SetAPI
Included in:
DataTypes::Tokeninfo, DataTypes::Userinfo
Defined in:
lib/paypal-sdk/core/openid_connect/request_data_type.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SetAPI

client_id=, client_secret=, set_config

Class Method Details

.apiObject

Global API object

Example

RequestDataType.api

15
16
17
# File 'lib/paypal-sdk/core/openid_connect/request_data_type.rb', line 15

def api
  @api ||= API.new({})
end

.client_idObject


19
20
21
# File 'lib/paypal-sdk/core/openid_connect/request_data_type.rb', line 19

def client_id
  api.config.openid_client_id || api.config.client_id
end

.client_secretObject


23
24
25
# File 'lib/paypal-sdk/core/openid_connect/request_data_type.rb', line 23

def client_secret
  api.config.openid_client_secret || api.config.client_secret
end

.included(klass) ⇒ Object

Configure depended module, when RequestDataType is include.

Example

class Payment < DataTypes
  include RequestDataType
end
Payment.set_config(..)
payment.set_config(..)
Payment.api
payment.api

41
42
43
44
45
46
47
# File 'lib/paypal-sdk/core/openid_connect/request_data_type.rb', line 41

def included(klass)
  klass.class_eval do
    extend GetAPI
    extend SetAPI
    include SetAPI
  end
end

Instance Method Details

#apiObject

Get a local API object or Class level API object


7
8
9
# File 'lib/paypal-sdk/core/openid_connect/request_data_type.rb', line 7

def api
  @api || self.class.api
end