Class: KcSdkCompany::Api::Base

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

Direct Known Subclasses

Orders

Instance Method Summary collapse

Constructor Details

#initialize(api) ⇒ Base

Returns a new instance of Base.



4
5
6
# File 'lib/kc-sdk-company/api/base.rb', line 4

def initialize(api)
  @api = api
end

Instance Method Details

#resourceObject



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

def resource
  @api.resource
end

#validate_keys!(hash, keys) ⇒ Object



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

def validate_keys!(hash, keys)
  keys.each do |k|
    raise ArgumentError, "required keywords: #{keys.join(', ')}" unless hash.key?(k)
  end
end