Class: Wrike3::Workflow
- Inherits:
-
Object
- Object
- Wrike3::Workflow
- Includes:
- Common
- Defined in:
- lib/wrike3/workflow.rb
Instance Attribute Summary
Attributes included from Common
Instance Method Summary collapse
-
#add(account_id, data = {}, options = {}) ⇒ Object
Add a new task.
- #details(account_id, id, options = {}) ⇒ Object
-
#initialize(wrike) ⇒ Workflow
constructor
A new instance of Workflow.
-
#list(account_id, options = {}) ⇒ Object
Get task list.
-
#update(id, data = {}, options = {}) ⇒ Object
Update a task.
Constructor Details
#initialize(wrike) ⇒ Workflow
Returns a new instance of Workflow.
5 6 7 |
# File 'lib/wrike3/workflow.rb', line 5 def initialize(wrike) @wrike = wrike end |
Instance Method Details
#add(account_id, data = {}, options = {}) ⇒ Object
Add a new task
20 21 22 |
# File 'lib/wrike3/workflow.rb', line 20 def add(account_id, data = {}, ={}) wrike.execute(:post, api_url("accounts/#{account_id}/workflows"), .merge(data)) end |
#details(account_id, id, options = {}) ⇒ Object
14 15 16 17 |
# File 'lib/wrike3/workflow.rb', line 14 def details(account_id, id, ={}) matters = wrike.execute(:get, api_url("accounts/#{account_id}/workflows"), ) matters['data'].find { |m| m['id'] == id } end |
#list(account_id, options = {}) ⇒ Object
Get task list
10 11 12 |
# File 'lib/wrike3/workflow.rb', line 10 def list(account_id, = {}) wrike.execute(:get, api_url("accounts/#{account_id}/workflows"), ) end |
#update(id, data = {}, options = {}) ⇒ Object
Update a task
25 26 27 |
# File 'lib/wrike3/workflow.rb', line 25 def update(id, data = {}, ={}) wrike.execute(:put, api_url("workflows/#{id}"), .merge(data)) end |