Class: Learndot::Entity
- Inherits:
-
Object
- Object
- Learndot::Entity
- Defined in:
- lib/learndot/entity.rb
Instance Method Summary collapse
- #create(entity_name, conditions) ⇒ Object
-
#initialize(api) ⇒ Entity
constructor
A new instance of Entity.
- #retrieve(entity_name, conditions, options = {orderBy: 'Name', asc: true}) ⇒ Object
- #update(entity_name, component_id, conditions = {}) ⇒ Object
Constructor Details
#initialize(api) ⇒ Entity
Returns a new instance of Entity.
2 3 4 |
# File 'lib/learndot/entity.rb', line 2 def initialize(api) @api = api end |
Instance Method Details
#create(entity_name, conditions) ⇒ Object
10 11 12 |
# File 'lib/learndot/entity.rb', line 10 def create(entity_name, conditions) @api.create(entity_name, conditions) end |
#retrieve(entity_name, conditions, options = {orderBy: 'Name', asc: true}) ⇒ Object
6 7 8 |
# File 'lib/learndot/entity.rb', line 6 def retrieve(entity_name, conditions, = {orderBy: 'Name', asc: true}) entity = @api.search(entity_name, conditions, ) end |
#update(entity_name, component_id, conditions = {}) ⇒ Object
14 15 16 |
# File 'lib/learndot/entity.rb', line 14 def update(entity_name, component_id, conditions={}) @api.update(entity_name, conditions, component_id) end |