Class: CakeMail::Country

Inherits:
Object
  • Object
show all
Defined in:
lib/cakemail/country.rb

Class Method Summary collapse

Class Method Details

.get_list(session) ⇒ Object

Retrieves the list of countries.



12
13
14
15
# File 'lib/cakemail/country.rb', line 12

def get_list(session)
  res = session.request("CakeMail::API::ClassCountry", "GetList", { })
  return res['country']
end

.get_provinces(country_id, user) ⇒ Object

Retrieves the list of provinces for a country (only us and ca for the moment).



17
18
19
20
# File 'lib/cakemail/country.rb', line 17

def get_provinces(country_id, user)
  res = session.request("CakeMail::API::ClassCountry", "GetProvinces", { :country_id => country_id, :user_key => user.user_key })
  return res['province']
end