yyyc514-campaign_monitor 1.3.2 → 1.3.2.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.
- data/campaign_monitor.gemspec +1 -1
- data/lib/campaign_monitor/campaign.rb +8 -6
- data/test/campaign_test.rb +2 -1
- metadata +1 -1
data/campaign_monitor.gemspec
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.platform = Gem::Platform::RUBY
|
|
3
3
|
s.name = 'campaign_monitor'
|
|
4
|
-
s.version = "1.3.2"
|
|
4
|
+
s.version = "1.3.2.1"
|
|
5
5
|
s.summary = 'Provides access to the Campaign Monitor API.'
|
|
6
6
|
s.description = <<-EOF
|
|
7
7
|
A simple wrapper class that provides basic access to the Campaign Monitor API.
|
|
@@ -193,17 +193,19 @@ class CampaignMonitor
|
|
|
193
193
|
end
|
|
194
194
|
end
|
|
195
195
|
|
|
196
|
-
# Calls Campaign.GetSummary.
|
|
197
|
-
# It will
|
|
196
|
+
# Calls Campaign.GetSummary. OYou probably should just use Campaign#summary which caches results
|
|
197
|
+
# It will raise ApiError if an error occurs
|
|
198
198
|
# Campaign#result will have the result of the API call
|
|
199
199
|
#
|
|
200
200
|
# Example
|
|
201
201
|
# @camp=@client.campaigns.first
|
|
202
|
-
# @camp.GetSummary
|
|
202
|
+
# @camp.GetSummary["Clicks"]
|
|
203
203
|
def GetSummary
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
handle_response(cm_client.Campaign_GetSummary('CampaignID' => self.id)) do |response|
|
|
205
|
+
@result=Result.new(response)
|
|
206
|
+
@summary=parse_summary(@result.raw)
|
|
207
|
+
end
|
|
208
|
+
@summary
|
|
207
209
|
end
|
|
208
210
|
|
|
209
211
|
# Convenience method for accessing summary details of a campaign
|
data/test/campaign_test.rb
CHANGED
|
@@ -37,9 +37,10 @@ class CampaignMonitorTest < Test::Unit::TestCase
|
|
|
37
37
|
assert_not_nil @campaign
|
|
38
38
|
assert_equal 12345, @campaign.id
|
|
39
39
|
assert_raises( CampaignMonitor::ApiError ) { @campaign.lists }
|
|
40
|
+
assert_raises( CampaignMonitor::ApiError ) { @campaign.GetSummary }
|
|
40
41
|
end
|
|
41
42
|
|
|
42
|
-
def
|
|
43
|
+
def test_bracket_lookup_for_existing
|
|
43
44
|
camp=CampaignMonitor::Campaign[@campaign.id]
|
|
44
45
|
assert_not_nil camp
|
|
45
46
|
camp.lists
|