Module: Workflows
- Included in:
- CRM
- Defined in:
- lib/user/crm/workflows.rb
Instance Method Summary collapse
-
#create_workflow(data) ⇒ Object
Create workflow.
-
#get_workflow(id, options = nil) ⇒ Object
Get workflow.
-
#get_workflows(options = nil) ⇒ Object
Get workflows.
-
#update_workflow(id, data) ⇒ Object
Update workflow.
Instance Method Details
permalink #create_workflow(data) ⇒ Object
Create workflow.
Create a workflow with data.
Parameters
- data
-
(Hash) – Data to be submitted.
Example
data = {
title: 'New Workflow',
object_type: 'deals'
}
@data = @mints_user.create_workflow(data.to_json)
53 54 55 |
# File 'lib/user/crm/workflows.rb', line 53 def create_workflow(data) @client.raw('post', '/crm/workflows/', nil, data) end |
permalink #get_workflow(id, options = nil) ⇒ Object
Get workflow.
Get a workflow.
Parameters
- id
-
(Integer) – Workflow id.
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_user.get_workflow(1)
Second Example
= { fields: 'id, title' }
@data = @mints_user.get_workflow(1, )
37 38 39 |
# File 'lib/user/crm/workflows.rb', line 37 def get_workflow(id, = nil) @client.raw('get', "/crm/workflows/#{id}", ) end |
permalink #get_workflows(options = nil) ⇒ Object
Get workflows.
Get a collection of workflows.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_user.get_workflows
Second Example
= { sort: 'title', fields: 'title' }
@data = @mints_user.get_workflows()
20 21 22 |
# File 'lib/user/crm/workflows.rb', line 20 def get_workflows( = nil) @client.raw('get', '/crm/workflows', ) end |
permalink #update_workflow(id, data) ⇒ Object
Update workflow.
Update a workflow info.
Parameters
- id
-
(Integer) – Workflow id.
- data
-
(Hash) – Data to be submitted.
Example
data = {
title: 'New Workflow Modified'
}
@data = @mints_user.update_workflow(7, data)
69 70 71 |
# File 'lib/user/crm/workflows.rb', line 69 def update_workflow(id, data) @client.raw('put', "/crm/workflows/#{id}", nil, correct_json(data)) end |