Class: Configure::Configurable

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

Overview

Holds all the configure functions for the properties that are configurable

Class Method Summary collapse

Class Method Details

.language(config) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/ngi/configure.rb', line 41

def self.language(config)
  v = JSArray.new(config.lang_types).to_str
  type = AskLoop.ask(check: config.lang_types, valid: v)

  curr_lang = config.global['language'][type]
  lang_opts = config.languages[type].reject { |l| l if curr_lang == l }

  v = JSArray.new(lang_opts).to_str
  language = AskLoop.ask(check: lang_opts, valid: v)

  answer = config.global['language']
  answer[type] = language

  answer
end