Class: EmailDirect::Workflow
- Inherits:
-
Object
- Object
- EmailDirect::Workflow
- Defined in:
- lib/emaildirect/workflow.rb
Overview
Represents a workflow and associated functionality
Instance Attribute Summary collapse
-
#workflow_id ⇒ Object
readonly
Returns the value of attribute workflow_id.
Class Method Summary collapse
Instance Method Summary collapse
- #add_emails(email_addresses) ⇒ Object
- #details ⇒ Object
-
#initialize(workflow_id) ⇒ Workflow
constructor
A new instance of Workflow.
- #members(options = {}) ⇒ Object
- #remove_emails(email_addresses) ⇒ Object
- #send_node_details(send_node_id) ⇒ Object
- #send_node_stats(send_node_id, options = {}) ⇒ Object
- #send_nodes ⇒ Object
- #start ⇒ Object
- #stats(options = {}) ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(workflow_id) ⇒ Workflow
Returns a new instance of Workflow.
16 17 18 |
# File 'lib/emaildirect/workflow.rb', line 16 def initialize(workflow_id) @workflow_id = workflow_id end |
Instance Attribute Details
#workflow_id ⇒ Object (readonly)
Returns the value of attribute workflow_id.
14 15 16 |
# File 'lib/emaildirect/workflow.rb', line 14 def workflow_id @workflow_id end |
Class Method Details
.all ⇒ Object
8 9 10 11 |
# File 'lib/emaildirect/workflow.rb', line 8 def all response = EmailDirect.get '/Workflows' Hashie::Mash.new(response) end |
Instance Method Details
#add_emails(email_addresses) ⇒ Object
60 61 62 63 64 |
# File 'lib/emaildirect/workflow.rb', line 60 def add_emails(email_addresses) = { :EmailAddresses => Array(email_addresses) } response = post 'AddEmails', :body => .to_json Hashie::Mash.new(response) end |
#details ⇒ Object
20 21 22 23 |
# File 'lib/emaildirect/workflow.rb', line 20 def details response = get Hashie::Mash.new(response) end |
#members(options = {}) ⇒ Object
25 26 27 28 |
# File 'lib/emaildirect/workflow.rb', line 25 def members( = {}) response = get 'Members', :query => Hashie::Mash.new(response) end |
#remove_emails(email_addresses) ⇒ Object
66 67 68 69 70 |
# File 'lib/emaildirect/workflow.rb', line 66 def remove_emails(email_addresses) = { :EmailAddresses => Array(email_addresses) } response = post 'RemoveEmails', :body => .to_json Hashie::Mash.new(response) end |
#send_node_details(send_node_id) ⇒ Object
40 41 42 43 |
# File 'lib/emaildirect/workflow.rb', line 40 def send_node_details(send_node_id) response = get "SendNodes/#{send_node_id}" Hashie::Mash.new(response) end |
#send_node_stats(send_node_id, options = {}) ⇒ Object
45 46 47 48 |
# File 'lib/emaildirect/workflow.rb', line 45 def send_node_stats(send_node_id, = {}) response = get "SendNodes/#{send_node_id}/Stats", :query => Hashie::Mash.new(response) end |
#send_nodes ⇒ Object
35 36 37 38 |
# File 'lib/emaildirect/workflow.rb', line 35 def send_nodes response = get 'SendNodes' Hashie::Mash.new(response) end |
#start ⇒ Object
50 51 52 53 |
# File 'lib/emaildirect/workflow.rb', line 50 def start response = EmailDirect.put '/Workflows/Start', :body => workflow_id.to_json Hashie::Mash.new(response) end |
#stats(options = {}) ⇒ Object
30 31 32 33 |
# File 'lib/emaildirect/workflow.rb', line 30 def stats( = {}) response = get 'Stats', :query => Hashie::Mash.new(response) end |
#stop ⇒ Object
55 56 57 58 |
# File 'lib/emaildirect/workflow.rb', line 55 def stop response = EmailDirect.put '/Workflows/Stop', :body => workflow_id.to_json Hashie::Mash.new(response) end |