Class: AmazonRuby::Locale

Inherits:
Object
  • Object
show all
Defined in:
lib/amazon-ruby/locale.rb

Constant Summary collapse

HOSTS =

Country hosts

{
      'ca' => 'ecs.amazonaws.ca',
      'cn' => 'webservices.amazon.cn',
      'de' => 'ecs.amazonaws.de',
      'fr' => 'ecs.amazonaws.fr',
      'it' => 'webservices.amazon.it',
      'jp' => 'ecs.amazonaws.jp',
      'us' => 'ecs.amazonaws.com',
      'uk' => 'ecs.amazonaws.co.uk'
}

Instance Method Summary collapse

Constructor Details

#initialize(country) ⇒ Locale

Set country on initialization, raise InvalidLocale if not found

Raises:



19
20
21
22
23
# File 'lib/amazon-ruby/locale.rb', line 19

def initialize(country)
  raise UnsupportedCountry unless HOSTS.keys.include?(country)
  @host = HOSTS[country]
  @country = country
end

Instance Method Details

#countryObject

Country



31
32
33
# File 'lib/amazon-ruby/locale.rb', line 31

def country
  @country
end

#hostObject

Host



26
27
28
# File 'lib/amazon-ruby/locale.rb', line 26

def host
  @host
end