Class: Learndot::LearningComponents

Inherits:
Object
  • Object
show all
Defined in:
lib/learndot/learning_components.rb

Instance Method Summary collapse

Constructor Details

#initialize(api) ⇒ LearningComponents

Returns a new instance of LearningComponents.



2
3
4
# File 'lib/learndot/learning_components.rb', line 2

def initialize(api)
  @api = api
end

Instance Method Details

#create_component(conditions) ⇒ Object



10
11
12
# File 'lib/learndot/learning_components.rb', line 10

def create_component(conditions)
  @api.create(:content_component, conditions)
end

#retrieve_component(conditions, options = {orderBy: 'Name', asc: true}) ⇒ Object



6
7
8
# File 'lib/learndot/learning_components.rb', line 6

def retrieve_component(conditions, options = {orderBy: 'Name', asc: true})
  learning_component = @api.search(:content_component, conditions, options)
end

#update_component(component_id, conditions = {}) ⇒ Object



14
15
16
# File 'lib/learndot/learning_components.rb', line 14

def update_component(component_id, conditions={})
  @api.update(:content_component, conditions, component_id)
end