Class: KcSdkCompany::Api::Base
- Inherits:
-
Object
- Object
- KcSdkCompany::Api::Base
- Defined in:
- lib/kc-sdk-company/api/base.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(api) ⇒ Base
constructor
A new instance of Base.
- #resource ⇒ Object
- #validate_keys!(hash, keys) ⇒ Object
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
#resource ⇒ Object
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 |