Class: KcSdkApp::Api
- Inherits:
-
Object
- Object
- KcSdkApp::Api
- Defined in:
- lib/kc-sdk-app/api.rb,
lib/kc-sdk-app/api/apps.rb,
lib/kc-sdk-app/api/base.rb,
lib/kc-sdk-app/api/orders.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#apps ⇒ Object
Returns the value of attribute apps.
-
#orders ⇒ Object
Returns the value of attribute orders.
Instance Method Summary collapse
-
#initialize(access_token: KcSdkApp.configuration.access_token) ⇒ Api
constructor
A new instance of Api.
- #resource ⇒ Object
Constructor Details
#initialize(access_token: KcSdkApp.configuration.access_token) ⇒ Api
Returns a new instance of Api.
11 12 13 14 15 |
# File 'lib/kc-sdk-app/api.rb', line 11 def initialize(access_token: KcSdkApp.configuration.access_token) self.access_token = access_token self.orders = KcSdkApp::Api::Orders.new(self) self.apps = KcSdkApp::Api::Apps.new(self) end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
7 8 9 |
# File 'lib/kc-sdk-app/api.rb', line 7 def access_token @access_token end |
#apps ⇒ Object
Returns the value of attribute apps.
9 10 11 |
# File 'lib/kc-sdk-app/api.rb', line 9 def apps @apps end |
#orders ⇒ Object
Returns the value of attribute orders.
8 9 10 |
# File 'lib/kc-sdk-app/api.rb', line 8 def orders @orders end |
Instance Method Details
#resource ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/kc-sdk-app/api.rb', line 17 def resource @resource ||= RestClient::Resource.new( "#{KcSdkApp.configuration.api_url}/api/app", log: KcSdkApp.configuration.logger, headers: { 'Authorization': "Bearer #{self.access_token}" } ) end |