Class: Llaxta

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

Constant Summary collapse

VERSION =
Gem::Version.new("0.0.4")

Class Method Summary collapse

Class Method Details

.alpha2(country_name, locale) ⇒ String

Parameters:

  • country_name (String)
  • locale (String)

Returns:

  • (String)


22
23
24
# File 'lib/llaxta.rb', line 22

def alpha2(country_name, locale)
  dictionary(locale).key(country_name)
end

.t(alpha2, locale) ⇒ String

Parameters:

  • alpha2 (String)
  • locale (String)

Returns:

  • (String)

Raises:



13
14
15
16
17
# File 'lib/llaxta.rb', line 13

def t(alpha2, locale)
  raise Exceptions::AlphaMissing unless alpha2

  dictionary(locale)[alpha2]
end