class ComplexConfig::Config
end
end
end
skip
else
Base64.decode64(base64_string)
if base64_string = ask_and_send(“#{id}_base64”)
config.add_plugin -> id do
ComplexConfig.configure do |config|
@example Adding custom plugins
end
config.env = ‘production’
config.deep_freeze = false
ComplexConfig.configure do |config|
@example Basic configuration
including environment settings, deep freezing behavior, and plugin registration.
This class provides a structured way to configure the ComplexConfig system,
Configuration class for setting up ComplexConfig behavior
def add_plugin(code)
-
(self)- Returns self for chaining
Parameters:
-
code(Proc) -- The plugin code to add
def add_plugin(code) plugins << code self end
def configure(provider)
-
(self)- Returns self for chaining
Parameters:
-
provider(ComplexConfig::Provider) -- The provider to configure
def configure(provider) each_pair do |name, value| value.nil? and next name == :plugins and next provider.__send__("#{name}=", value) end plugins.each do |code| provider.add_plugin(code) end self end
def initialize(*)
def initialize(*) super self.plugins = [] end