Class: DoceboRuby::Resource

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/docebo_ruby/resource.rb

Direct Known Subclasses

Course

Class Method Summary collapse

Class Method Details

.apiObject


7
8
9
# File 'lib/docebo_ruby/resource.rb', line 7

def self.api
  @api
end

.api=(api) ⇒ Object


3
4
5
# File 'lib/docebo_ruby/resource.rb', line 3

def self.api=(api)
  @api = api
end

.fetch_data(method, &block) ⇒ Object


11
12
13
14
15
16
# File 'lib/docebo_ruby/resource.rb', line 11

def self.fetch_data(method, &block)
  @fetcher = API.new
  @fetcher.send_request(@api, 'listCourses', {}) do |result|
    yield result
  end
end