Class: Learndot::Entity

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

Instance Method Summary collapse

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, options = {orderBy: 'Name', asc: true})
  entity = @api.search(entity_name, conditions, options)
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