Module: Amazon::Hacks::Countries
Overview
The countries module is a convenience mixin to retrieve the correct server, etc. for an Image or Link. This module requires the class to include a @country instance variable.
Instance Method Summary collapse
-
#country_host ⇒ Object
Returns a hostname for the Amazon store for that country.
-
#country_imgcode ⇒ Object
Each country in Amazon seems to use a different image code number in its images (eg, “01” for the US, “08” for France).
-
#country_imghost ⇒ Object
Each country also has a different server for its images.
Instance Method Details
#country_host ⇒ Object
Returns a hostname for the Amazon store for that country
35 36 37 |
# File 'lib/amazon-hacks.rb', line 35 def country_host COUNTRIES[@country].host end |
#country_imgcode ⇒ Object
Each country in Amazon seems to use a different image code number in its images (eg, “01” for the US, “08” for France). This method returns the image code for the country
43 44 45 |
# File 'lib/amazon-hacks.rb', line 43 def country_imgcode COUNTRIES[@country].img_code end |
#country_imghost ⇒ Object
Each country also has a different server for its images. This returns the correct server.
50 51 52 |
# File 'lib/amazon-hacks.rb', line 50 def country_imghost COUNTRIES[@country].img_host end |