Module: KalturaBox::Category::InstanceMethods

Defined in:
lib/kaltura_box/category/instance_methods.rb

Instance Method Summary collapse

Instance Method Details

#edit(options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/kaltura_box/category/instance_methods.rb', line 7

def edit(options={})
  client = KalturaBox::Client.update_session
  category_svc = Kaltura::KalturaCategoryService.new(client)

  category = Kaltura::KalturaCategory.new
  category.name = options[:name]
  category.description = options[:description]

  if category = category_svc.update(self.ref_id, category)
    self.update(name: category.name, description: category.description)
  end
end

#removeObject



20
21
22
23
24
25
26
# File 'lib/kaltura_box/category/instance_methods.rb', line 20

def remove
  client = KalturaBox::Client.update_session
  category_svc = Kaltura::KalturaCategoryService.new(client)

  result = category_svc.delete(self.ref_id) # should returns nil
  self.destroy
end