Module: ChatWork::Task
- Extended by:
- EntityMethods
- Defined in:
- lib/chatwork/task.rb
Class Method Summary collapse
-
.create(room_id:, body:, to_ids:, limit: nil) ⇒ Hashie::Mash
Add a new task to the chat.
-
.find(room_id:, task_id:) ⇒ Hashie::Mash
Get information about the specified task.
-
.get(room_id:, account_id:, assigned_by_account_id: nil, status: nil) ⇒ Array<Hashie::Mash>
Get the list of tasks associated with the specified chat.
Class Method Details
.create(room_id:, body:, to_ids:, limit: nil) ⇒ Hashie::Mash
Add a new task to the chat
59 60 61 62 63 64 65 66 67 |
# File 'lib/chatwork/task.rb', line 59 def self.create(room_id:, body:, to_ids:, limit: nil) params = { body: body, to_ids: Array(to_ids).join(","), } params[:limit] = limit.to_i if limit _post("/rooms/#{room_id}/tasks", params) end |
.find(room_id:, task_id:) ⇒ Hashie::Mash
Get information about the specified task
97 98 99 |
# File 'lib/chatwork/task.rb', line 97 def self.find(room_id:, task_id:) _get("/rooms/#{room_id}/tasks/#{task_id}") end |
.get(room_id:, account_id:, assigned_by_account_id: nil, status: nil) ⇒ Array<Hashie::Mash>
Get the list of tasks associated with the specified chat
(*This method returns up to 100 entries. We are planning to implement pagination to support larger number of data retrieval)
39 40 41 |
# File 'lib/chatwork/task.rb', line 39 def self.get(room_id:, account_id:, assigned_by_account_id: nil, status: nil) _get("/rooms/#{room_id}/tasks", account_id: account_id, assigned_by_account_id: assigned_by_account_id, status: status) end |