0exp / qonfig

Powerful configuration Ruby-framework with a support for many commonly used config formats with a multi-functional API, developer-friendly DSL and object-oriented behavior.
MIT License
23 stars 8 forks source link

[sub-config] An ability to export a set of sub-settings as a new Qonfig::DataSet instance #106

Open 0exp opened 4 years ago

0exp commented 4 years ago

Closes #104


Concept:

class Config < Qonfig::DataSet
  setting :database do
    setting :host
    setting :port
  end
end

config = Config.new
sub_config = config.sub_config(:database) # => <Qonfig::DataSet:0x00007ff8>

sub_config.to_h
# =>
{ host: nil, port: nil }