Class: EmailDirect::SuppressionList
- Inherits:
-
Object
- Object
- EmailDirect::SuppressionList
- Defined in:
- lib/emaildirect/suppression_list.rb
Overview
Represents a list and associated functionality
Instance Attribute Summary collapse
-
#suppression_list_id ⇒ Object
readonly
Returns the value of attribute suppression_list_id.
Class Method Summary collapse
Instance Method Summary collapse
- #add_domains(domain_addresses) ⇒ Object
- #add_emails(email_addresses) ⇒ Object
- #delete ⇒ Object
- #details ⇒ Object
- #domains(options = {}) ⇒ Object
- #emails(options = {}) ⇒ Object
-
#initialize(suppression_list_id) ⇒ SuppressionList
constructor
A new instance of SuppressionList.
- #remove_domains(domain_addresses) ⇒ Object
- #remove_emails(email_addresses) ⇒ Object
- #update(name) ⇒ Object
Constructor Details
#initialize(suppression_list_id) ⇒ SuppressionList
Returns a new instance of SuppressionList.
21 22 23 |
# File 'lib/emaildirect/suppression_list.rb', line 21 def initialize(suppression_list_id) @suppression_list_id = suppression_list_id end |
Instance Attribute Details
#suppression_list_id ⇒ Object (readonly)
Returns the value of attribute suppression_list_id.
19 20 21 |
# File 'lib/emaildirect/suppression_list.rb', line 19 def suppression_list_id @suppression_list_id end |
Class Method Details
.all ⇒ Object
8 9 10 11 |
# File 'lib/emaildirect/suppression_list.rb', line 8 def all response = EmailDirect.get '/SuppressionLists' Hashie::Mash.new(response) end |
.create(name) ⇒ Object
13 14 15 16 |
# File 'lib/emaildirect/suppression_list.rb', line 13 def create(name) response = EmailDirect.post '/SuppressionLists', :body => name.to_json Hashie::Mash.new(response) end |
Instance Method Details
#add_domains(domain_addresses) ⇒ Object
62 63 64 65 66 |
# File 'lib/emaildirect/suppression_list.rb', line 62 def add_domains(domain_addresses) = { :DomainNames => Array(domain_addresses) } response = post 'AddDomains', :body => .to_json Hashie::Mash.new(response) end |
#add_emails(email_addresses) ⇒ Object
50 51 52 53 54 |
# File 'lib/emaildirect/suppression_list.rb', line 50 def add_emails(email_addresses) = { :EmailAddresses => Array(email_addresses) } response = post 'AddEmails', :body => .to_json Hashie::Mash.new(response) end |
#delete ⇒ Object
45 46 47 48 |
# File 'lib/emaildirect/suppression_list.rb', line 45 def delete response = EmailDirect.delete uri_for, {} Hashie::Mash.new(response) end |
#details ⇒ Object
25 26 27 28 |
# File 'lib/emaildirect/suppression_list.rb', line 25 def details response = get Hashie::Mash.new(response) end |
#domains(options = {}) ⇒ Object
35 36 37 38 |
# File 'lib/emaildirect/suppression_list.rb', line 35 def domains( = {}) response = get 'Domains', :query => Hashie::Mash.new(response) end |
#emails(options = {}) ⇒ Object
30 31 32 33 |
# File 'lib/emaildirect/suppression_list.rb', line 30 def emails( = {}) response = get 'Emails', :query => Hashie::Mash.new(response) end |
#remove_domains(domain_addresses) ⇒ Object
68 69 70 71 72 |
# File 'lib/emaildirect/suppression_list.rb', line 68 def remove_domains(domain_addresses) = { :DomainNames => Array(domain_addresses) } response = post 'RemoveDomains', :body => .to_json Hashie::Mash.new(response) end |
#remove_emails(email_addresses) ⇒ Object
56 57 58 59 60 |
# File 'lib/emaildirect/suppression_list.rb', line 56 def remove_emails(email_addresses) = { :EmailAddresses => Array(email_addresses) } response = post 'RemoveEmails', :body => .to_json Hashie::Mash.new(response) end |
#update(name) ⇒ Object
40 41 42 43 |
# File 'lib/emaildirect/suppression_list.rb', line 40 def update(name) response = EmailDirect.put uri_for, :body => name.to_json Hashie::Mash.new(response) end |