Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
add countries and timezone calls
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Feb 21, 2009
1 parent 5703113 commit 2b50d47
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/campaign_monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ def parsed_system_date
DateTime.strptime(system_date, timestamp_format)
end

def countries
handle_response(User_GetCountries()) do | response |
response["string"]
end
end

def timezones
handle_response(User_GetTimezones()) do | response |
response["string"]
end
end

# Returns an array of Campaign objects associated with the specified Client ID
#
# Example
Expand Down
10 changes: 10 additions & 0 deletions test/campaign_monitor_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ def test_can_access_two_accounts_at_once
assert_equal "abcdef", @client2.cm_client.api_key
end

def test_timezones
assert_equal 90, @cm.timezones.length
end

def test_countries
countries=@cm.countries
assert_equal 246, countries.length
assert countries.include?("United States of America")
end


# campaigns

Expand Down

0 comments on commit 2b50d47

Please sign in to comment.