Class: ConfSources::File
Instance Attribute Summary
Attributes inherited from Default
Instance Method Summary collapse
-
#initialize(conf_file) ⇒ File
constructor
A new instance of File.
Methods inherited from Default
#[], #export_to, #is_defined?, #merge, #merge!, #to_a, #to_pairs, #to_s, #validate!
Constructor Details
#initialize(conf_file) ⇒ File
80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/confsources.rb', line 80 def initialize conf_file loaded_yaml = YAML.load_file conf_file if loaded_yaml.is_a? Hash = loaded_yaml.select { |k,v| ConfSources::is_option_exist? k.to_sym and not v.nil? }.collect { |k,v| candidate = ConfMaker::.select{|e|e[:name] == k.to_sym}.first.clone candidate[:value] = v candidate } else = [] end end |