class AlohaAnalyzer::Language

Constants

ALIASES
LANGUAGES

Public Class Methods

aliases() click to toggle source
# File lib/aloha_analyzer/language.rb, line 13
def self.aliases
  ALIASES['aliases']
end
all() click to toggle source
# File lib/aloha_analyzer/language.rb, line 9
def self.all
  LANGUAGES['languages']
end
find_by_abbreviation(abbreviation, network) click to toggle source
# File lib/aloha_analyzer/language.rb, line 17
def self.find_by_abbreviation(abbreviation, network)
  if LANGUAGES['languages'][abbreviation]
    format(LANGUAGES['languages'][abbreviation], network)
  else
    format(LANGUAGES['languages']['other'], network)
  end
end
format(language, network) click to toggle source
# File lib/aloha_analyzer/language.rb, line 25
def self.format(language, network)
  {
    'abbreviation' => language['abbreviation'],
    'name'         => language['name'],
    'population'   => language["#{network}_population"],
    'countries'    => language['countries'],
    'greeting'     => language['greeting']
  }
end