module GLanguage

Constants

Afrikaans
Albanian
Arabic
Belarusian
Bulgarian
Catalan
Chinese_Simplified
Chinese_Traditional
Croatian
Czech
Danish
Dutch
English
Estonian
Filipino
Finnish
French
Galician
German
Greek
Haitian_Creole
Hebrew
Hindi
Hungarian
Icelandic
Indonesian
Irish
Italian
Japanese
Latvian
Lithuanian
Macedonian
Malay
Maltese
Norwegian
Persian
Polish
Portuguese
Romanian
Russian
Serbian
Slovak
Slovenian
Spanish
Swahili
Swedish
Thai
Turkish
Ukrainian
Vietnamese
Welsh
Yiddish

Public Class Methods

lookup(symbol) click to toggle source

This method will look up a particular symbol and try to return a correspondind constant as a string

# File lib/glanguage.rb, line 58
def self.lookup(symbol)
  result = self.constants.select do |const|
    eval("self::#{const}").eql?(symbol)
  end
  if result.empty?
    raise NameError, "Looks like '#{symbol}' is not a symbol of a supported language"
  else
    result.to_s
  end
end