Class | Core::Config::Factory |
In: |
core/config.rb
|
Parent: | Object |
Configuration Parser Factory class, used to get a valid configuration parser for a given filename. The filename‘s extension is used to instantiate a valid ParserInterface implementation.
Given a configuration filename, this function returns a configuration parser object that is able to read the values from the file.
# File core/config.rb, line 123 def Factory.from(file) type = File.extname(file).to_sym @@factories.each do |parser| parser.get_type() == type return parser.new(file) end end