Class: KcSdkCompany::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/kc-sdk-company/api.rb,
lib/kc-sdk-company/api/base.rb,
lib/kc-sdk-company/api/orders.rb

Defined Under Namespace

Classes: Base, Orders

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeApi

Returns a new instance of Api.



8
9
10
# File 'lib/kc-sdk-company/api.rb', line 8

def initialize
  self.orders = KcSdkCompany::Api::Orders.new(self)
end

Instance Attribute Details

#ordersObject

Returns the value of attribute orders.



6
7
8
# File 'lib/kc-sdk-company/api.rb', line 6

def orders
  @orders
end

Instance Method Details

#resourceObject



12
13
14
15
16
17
18
# File 'lib/kc-sdk-company/api.rb', line 12

def resource
  @resource ||= RestClient::Resource.new(
    "#{KcSdkCompany.configuration.api_url}/api/company",
    log: KcSdkCompany.configuration.logger,
    headers: { 'Authorization': "Bearer #{KcSdkCompany.configuration.access_token}" }
  )
end