Class: Wrike3::Workflow

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/wrike3/workflow.rb

Instance Attribute Summary

Attributes included from Common

#wrike

Instance Method Summary collapse

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(, data = {}, options={})
  wrike.execute(:post, api_url("accounts/#{}/workflows"), options.merge(data))
end

#details(account_id, id, options = {}) ⇒ Object



14
15
16
17
# File 'lib/wrike3/workflow.rb', line 14

def details(, id, options={})
  matters = wrike.execute(:get, api_url("accounts/#{}/workflows"), options)
  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(, options = {})
  wrike.execute(:get, api_url("accounts/#{}/workflows"), options)
end

#update(id, data = {}, options = {}) ⇒ Object

Update a task



25
26
27
# File 'lib/wrike3/workflow.rb', line 25

def update(id, data = {}, options={})
  wrike.execute(:put, api_url("workflows/#{id}"), options.merge(data))
end