Class: Kaltura::Service::CategoryService
- Inherits:
-
BaseService
- Object
- BaseService
- Kaltura::Service::CategoryService
- Defined in:
- lib/kaltura/service/category_service.rb
Overview
CategoryService is responsible for adding and managing Categories. Categories are the main means to filter entries within the KMC.
Instance Attribute Summary
Attributes inherited from BaseService
Instance Method Summary collapse
-
#add(category) ⇒ Kaltura::Category
Adds a new Category.
-
#delete(id) ⇒ nil
Deletes the requested Category.
-
#get(id) ⇒ Kaltura::Category
Retrieves a category by it’s ID.
-
#list(filter = nil) ⇒ Kaltura::Response::CategoryListResponse
Lists all Categories given the specified filter.
-
#update(id, category) ⇒ Kaltura::Category
Updates a category.
Methods inherited from BaseService
Constructor Details
This class inherits a constructor from Kaltura::Service::BaseService
Instance Method Details
#add(category) ⇒ Kaltura::Category
Adds a new Category.
40 41 42 43 44 |
# File 'lib/kaltura/service/category_service.rb', line 40 def add(category) kparams = {} client.add_param(kparams, 'category', category) perform_request('category','add',kparams,false) end |
#delete(id) ⇒ nil
Deletes the requested Category. I am fairly confident that this will not actually clear the category from each entry, but it is no longer a filter on the KMC.
90 91 92 93 94 |
# File 'lib/kaltura/service/category_service.rb', line 90 def delete(id) kparams = {} client.add_param(kparams, 'id', id) perform_request('category','delete',kparams,false) end |
#get(id) ⇒ Kaltura::Category
Retrieves a category by it’s ID.
55 56 57 58 59 |
# File 'lib/kaltura/service/category_service.rb', line 55 def get(id) kparams = {} client.add_param(kparams, 'id', id) perform_request('category','get',kparams,false) end |
#list(filter = nil) ⇒ Kaltura::Response::CategoryListResponse
Lists all Categories given the specified filter.
105 106 107 108 109 |
# File 'lib/kaltura/service/category_service.rb', line 105 def list(filter=nil) kparams = {} client.add_param(kparams, 'filter', filter) perform_request('category','list',kparams,false) end |
#update(id, category) ⇒ Kaltura::Category
Updates a category. The best practice as with all updates would be to insantiate a new Kaltura::Category and update specific fields.
72 73 74 75 76 77 |
# File 'lib/kaltura/service/category_service.rb', line 72 def update(id, category) kparams = {} client.add_param(kparams, 'id', id) client.add_param(kparams, 'category', category) perform_request('category','update',kparams,false) end |