mailbuild 1.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/mailbuild/mailbuild.rb +14 -7
  2. metadata +3 -3
@@ -14,8 +14,9 @@ class Mailbuild
14
14
  # Implements Subscriber.Add
15
15
  # http://www.mailbuild.com/api/subscriber.add.aspx
16
16
  #
17
- def self.add(email, name, list_id = @@default_list_id)
17
+ def self.add(email, name, list_id = nil)
18
18
  self.connect
19
+ list_id ||= @@default_list_id
19
20
  result = @@service.AddSubscriber({:ApiKey=>@@api_key, :ListID=>list_id, :Email=>email, :Name=>name})
20
21
  response = result.subscriber_AddResult
21
22
  self.parse_response(response, 'Subscriber.Add')
@@ -24,8 +25,9 @@ class Mailbuild
24
25
  # Implements Subscriber.AddWithCustomFields
25
26
  # http://www.mailbuild.com/api/subscriber.addwithcustomfields.aspx
26
27
  #
27
- def self.add_with_custom_field(email, name, custom_fields = {}, list_id = @@default_list_id)
28
+ def self.add_with_custom_field(email, name, custom_fields = {}, list_id = nil)
28
29
  self.connect
30
+ list_id ||= @@default_list_id
29
31
 
30
32
  # Convert custom fields to an array of hashes
31
33
  custom = custom_fields.collect{|key, value| {:Key => key.to_s, :Value => value}}
@@ -38,8 +40,9 @@ class Mailbuild
38
40
  # Implements <tt>Subscriber.Unsubscribe</tt>
39
41
  # http://www.mailbuild.com/api/subscriber.unsubscribe.aspx
40
42
  #
41
- def self.unsubscribe(email, list_id = @@default_list_id)
43
+ def self.unsubscribe(email, list_id = nil)
42
44
  self.connect
45
+ list_id ||= @@default_list_id
43
46
  result = @@service.Unsubscribe({:ApiKey=>@@api_key, :ListID=>list_id, :Email=>email})
44
47
  response = result.subscriber_UnsubscribeResult
45
48
  self.parse_response(response, 'Subscriber.Unsubscribe')
@@ -49,8 +52,9 @@ class Mailbuild
49
52
  #
50
53
  # Implements Subscribers.GetSingleSubscriber
51
54
  #
52
- def self.subscriber(email, list_id = @@default_list_id)
55
+ def self.subscriber(email, list_id = nil)
53
56
  self.connect
57
+ list_id ||= @@default_list_id
54
58
  result = @@service.GetSingleSubscriber({:ApiKey=>@@api_key, :ListID=>list_id, :EmailAddress=>email})
55
59
  subscriber = result.subscribers_GetSingleSubscriberResult
56
60
  self.parse_response(subscriber, 'Subscribers.GetSingleSubscriber')
@@ -62,8 +66,9 @@ class Mailbuild
62
66
  # Implements Subscribers.GetActive
63
67
  # http://www.mailbuild.com/api/Subscribers.GetActive.aspx
64
68
  #
65
- def self.subscribers(date, list_id = @@default_list_id)
69
+ def self.subscribers(date, list_id = nil)
66
70
  self.connect
71
+ list_id ||= @@default_list_id
67
72
  result = @@service.GetSubscribers({:ApiKey=>@@api_key, :ListID=>list_id, :Date=>date})
68
73
  subscribers = result.subscribers_GetActiveResult
69
74
  self.parse_response(subscribers, 'Subscribers.GetSubscribers')
@@ -72,8 +77,9 @@ class Mailbuild
72
77
  # Implements Subscribers.GetUnsubscribed
73
78
  # http://www.mailbuild.com/api/Subscribers.GetUnsubscribed.aspx
74
79
  #
75
- def self.unsubscribed(date, list_id = @@default_list_id)
80
+ def self.unsubscribed(date, list_id = nil)
76
81
  self.connect
82
+ list_id ||= @@default_list_id
77
83
  result = @@service.GetUnsubscribed({:ApiKey=>@@api_key, :ListID=>list_id, :Date=>date})
78
84
  unsubscribed = result.subscribers_GetUnsubscribedResult
79
85
  self.parse_response(unsubscribed, 'Subscribers.GetUnsubscribed')
@@ -82,8 +88,9 @@ class Mailbuild
82
88
  # Implements Subscribers.GetBounced
83
89
  # http://www.mailbuild.com/api/Subscribers.GetBounced.aspx
84
90
  #
85
- def self.bounced(date, list_id = @@default_list_id)
91
+ def self.bounced(date, list_id = nil)
86
92
  self.connect
93
+ list_id ||= @@default_list_id
87
94
  result = @@service.GetBounced({:ApiKey=>@@api_key, :ListID=>list_id, :Date=>date})
88
95
  bounced = result.subscribers_GetBouncedResult
89
96
  self.parse_response(bounced, 'Subscribers.GetBounced')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailbuild
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.1"
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Yule
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-03 00:00:00 +01:00
12
+ date: 2008-11-07 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -57,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  requirements: []
58
58
 
59
59
  rubyforge_project: mailbuild
60
- rubygems_version: 1.1.1
60
+ rubygems_version: 1.3.0
61
61
  signing_key:
62
62
  specification_version: 2
63
63
  summary: Ruby interface to the Mailbuild API.