Class: Kentaa::Api::Resources::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/kentaa/api/resources/base.rb

Direct Known Subclasses

List, Resource

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, options = {}) ⇒ Base

Returns a new instance of Base.



9
10
11
12
# File 'lib/kentaa/api/resources/base.rb', line 9

def initialize(config, options = {})
  @config = config
  @options = options
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



7
8
9
# File 'lib/kentaa/api/resources/base.rb', line 7

def config
  @config
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/kentaa/api/resources/base.rb', line 7

def options
  @options
end

Instance Method Details

#loadObject



14
15
16
17
18
# File 'lib/kentaa/api/resources/base.rb', line 14

def load
  @response ||= load_resource(options)

  self
end

#loaded?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/kentaa/api/resources/base.rb', line 20

def loaded?
  !@response.nil?
end