Class: Learndot::LearningComponents
- Inherits:
-
Object
- Object
- Learndot::LearningComponents
- Defined in:
- lib/learndot/learning_components.rb
Instance Method Summary collapse
- #create_component(conditions) ⇒ Object
-
#initialize(api) ⇒ LearningComponents
constructor
A new instance of LearningComponents.
- #retrieve_component(conditions, options = {orderBy: 'Name', asc: true}) ⇒ Object
- #update_component(component_id, conditions = {}) ⇒ Object
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, = {orderBy: 'Name', asc: true}) learning_component = @api.search(:content_component, conditions, ) 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 |