Module: RubyLokaliseApi::Rest::Tasks
- Included in:
- RubyLokaliseApi::Rest
- Defined in:
- lib/ruby_lokalise_api/rest/tasks.rb
Instance Method Summary collapse
-
#create_task(project_id, req_params) ⇒ RubyLokaliseApi::Resources::Task
Creates a new task.
-
#destroy_task(project_id, task_id) ⇒ RubyLokaliseApi::Generics::DeletedResource
Deletes a task.
-
#task(project_id, task_id, req_params = {}) ⇒ RubyLokaliseApi::Resources::Task
Returns a single task.
-
#tasks(project_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::Tasks
Returns project tasks.
-
#update_task(project_id, task_id, req_params = {}) ⇒ RubyLokaliseApi::Resources::Task
Updates a task.
Instance Method Details
#create_task(project_id, req_params) ⇒ RubyLokaliseApi::Resources::Task
Creates a new task
42 43 44 45 46 47 48 |
# File 'lib/ruby_lokalise_api/rest/tasks.rb', line 42 def create_task(project_id, req_params) params = { query: project_id, req: req_params } data = endpoint(name: 'Tasks', params: params).do_post resource 'Task', data end |
#destroy_task(project_id, task_id) ⇒ RubyLokaliseApi::Generics::DeletedResource
Deletes a task
71 72 73 74 75 76 77 |
# File 'lib/ruby_lokalise_api/rest/tasks.rb', line 71 def destroy_task(project_id, task_id) params = { query: [project_id, task_id] } data = endpoint(name: 'Tasks', params: params).do_delete RubyLokaliseApi::Generics::DeletedResource.new data.content end |
#task(project_id, task_id, req_params = {}) ⇒ RubyLokaliseApi::Resources::Task
Returns a single task
28 29 30 31 32 33 34 |
# File 'lib/ruby_lokalise_api/rest/tasks.rb', line 28 def task(project_id, task_id, req_params = {}) params = { query: [project_id, task_id], req: req_params } data = endpoint(name: 'Tasks', params: params).do_get resource 'Task', data end |
#tasks(project_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::Tasks
Returns project tasks
12 13 14 15 16 17 18 19 |
# File 'lib/ruby_lokalise_api/rest/tasks.rb', line 12 def tasks(project_id, req_params = {}) name = 'Tasks' params = { query: project_id, req: req_params } data = endpoint(name: name, params: params).do_get collection name, data end |
#update_task(project_id, task_id, req_params = {}) ⇒ RubyLokaliseApi::Resources::Task
Updates a task
57 58 59 60 61 62 63 |
# File 'lib/ruby_lokalise_api/rest/tasks.rb', line 57 def update_task(project_id, task_id, req_params = {}) params = { query: [project_id, task_id], req: req_params } data = endpoint(name: 'Tasks', params: params).do_put resource 'Task', data end |