Class: Orthoses::Config
- Inherits:
-
Object
- Object
- Orthoses::Config
- Defined in:
- lib/orthoses/config.rb,
lib/orthoses/config/version.rb
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(loader, except_keys: []) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(loader, except_keys: []) ⇒ Config
Returns a new instance of Config.
8 9 10 11 |
# File 'lib/orthoses/config.rb', line 8 def initialize(loader, except_keys: []) @loader = loader @except_keys = except_keys end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/orthoses/config.rb', line 13 def call @loader.call.tap do |store| const_name = ::Config.const_name store["Object"] << "#{const_name}: (::Config::Options & ::Config::_Options_Root)" settings = ::Object.const_get(const_name) @except_keys.each do |except_key| settings.delete_field(except_key) {} # Ignore if key does not exist end create_interface(store, settings, "Root") end end |