Method: LangFactory#initialize

Defined in:
lib/asker/lang/lang_factory.rb

#initializeLangFactory

Returns a new instance of LangFactory.



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/asker/lang/lang_factory.rb', line 15

def initialize
  # Read all language codes from configuration file and load every language
  @default = Application.instance.config["languages"]["default"].downcase
  @langs = {}
  Application.instance.config["languages"].each_pair do |key, value|
    code = key.downcase
    next if code == "default"

    @langs[code] = Lang.new(code) if value.downcase == "yes"
  end
end