Module: Gaigo::Utilities

Included in:
ActionViewExtension, ActiveRecordExtension
Defined in:
lib/gaigo/utilities.rb

Instance Method Summary collapse

Instance Method Details

#check_country_code(code) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/gaigo/utilities.rb', line 13

def check_country_code(code)
  if country = COUNTRIES.get(code)
    country.code
  else
    raise(Exception, "Unacceptable country code: #{code}")
  end
end

#check_locale_code(code) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/gaigo/utilities.rb', line 5

def check_locale_code(code)
  if lang = LANGS.get(code)
    lang.code
  else
    raise(Exception, "Unacceptable locale code: #{code}")
  end
end