Class: Gemgento::API::SOAP::Directory::Country
- Inherits:
-
Object
- Object
- Gemgento::API::SOAP::Directory::Country
- Defined in:
- lib/gemgento/api/soap/directory/country.rb
Class Method Summary collapse
-
.fetch_all ⇒ Void
Fetch all Countries from Magento and sync them to Gemgento.
-
.list ⇒ Gemgento::MagentoResponse
Get a list of Countries from Magento.
Class Method Details
.fetch_all ⇒ Void
Fetch all Countries from Magento and sync them to Gemgento.
10 11 12 13 14 15 16 17 18 |
# File 'lib/gemgento/api/soap/directory/country.rb', line 10 def self.fetch_all response = list if response.success? response.body[:countries][:item].each do |country| sync_magento_to_local(country) end end end |
.list ⇒ Gemgento::MagentoResponse
Get a list of Countries from Magento.
23 24 25 26 27 28 29 30 31 |
# File 'lib/gemgento/api/soap/directory/country.rb', line 23 def self.list response = MagentoApi.create_call(:directory_country_list) if response.success? && !response.body[:countries][:item].is_a?(Array) response.body[:countries][:item] = [response.body[:countries][:item]] end return response end |