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:



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

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

Instance Method Details

#countryObject

Country



29
30
31
# File 'lib/amazon-ruby/locale.rb', line 29

def country
  @country
end

#hostObject

Host



24
25
26
# File 'lib/amazon-ruby/locale.rb', line 24

def host
  @host
end