class Hocon::ConfigFactory
Public Class Methods
default_reference()
click to toggle source
# File lib/hocon/config_factory.rb, line 55 def self.default_reference Hocon::Impl::ConfigImpl.default_reference end
empty(origin_description = nil)
click to toggle source
# File lib/hocon/config_factory.rb, line 21 def self.empty(origin_description = nil) Hocon::Impl::ConfigImpl.empty_config(origin_description) end
load_file(file_base_name, parse_options = nil, resolve_options = nil)
click to toggle source
Because of how optional arguments work, if either parse or resolve options is supplied both must be supplied. ::load_file_with_parse_options or ::load_file_with_resolve_options can be used instead, or the argument you don't care about in ::load_file can be nil
e.g.: ::load_file(“settings”, my_parse_options, nil) is equivalent to: ::load_file_with_parse_options(“settings”, my_parse_options)
# File lib/hocon/config_factory.rb, line 33 def self.load_file(file_base_name, parse_options = nil, resolve_options = nil) parse_options ||= Hocon::ConfigParseOptions.defaults resolve_options ||= Hocon::ConfigResolveOptions.defaults config = Hocon::ConfigFactory.parse_file_any_syntax(file_base_name, parse_options) self.load_from_config(config, resolve_options) end
load_file_with_parse_options(file_base_name, parse_options)
click to toggle source
# File lib/hocon/config_factory.rb, line 42 def self.load_file_with_parse_options(file_base_name, parse_options) self.load_file(file_base_name, parse_options, nil) end
load_file_with_resolve_options(file_base_name, resolve_options)
click to toggle source
# File lib/hocon/config_factory.rb, line 46 def self.load_file_with_resolve_options(file_base_name, resolve_options) self.load_file(file_base_name, nil, resolve_options) end
load_from_config(config, resolve_options)
click to toggle source
# File lib/hocon/config_factory.rb, line 50 def self.load_from_config(config, resolve_options) config.with_fallback(self.default_reference).resolve(resolve_options) end
parse_file(file_path, options = Hocon::ConfigParseOptions.defaults)
click to toggle source
# File lib/hocon/config_factory.rb, line 9 def self.parse_file(file_path, options = Hocon::ConfigParseOptions.defaults) Hocon::Impl::Parseable.new_file(file_path, options).parse.to_config end
parse_file_any_syntax(file_base_name, options)
click to toggle source
# File lib/hocon/config_factory.rb, line 17 def self.parse_file_any_syntax(file_base_name, options) Hocon::Impl::ConfigImpl.parse_file_any_syntax(file_base_name, options).to_config end
parse_string(string, options = Hocon::ConfigParseOptions.defaults)
click to toggle source
# File lib/hocon/config_factory.rb, line 13 def self.parse_string(string, options = Hocon::ConfigParseOptions.defaults) Hocon::Impl::Parseable.new_string(string, options).parse.to_config end