Class: Sinclair::ConfigBuilder Private
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class responsible for setting the values on configuration
Instance Method Summary collapse
-
#initialize(config, *config_attributes) ⇒ ConfigBuilder
constructor
private
A new instance of ConfigBuilder.
Constructor Details
#initialize(config, *config_attributes) ⇒ ConfigBuilder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
A new instance of ConfigBuilder
33 34 35 36 |
# File 'lib/sinclair/config_builder.rb', line 33 def initialize(config, *config_attributes) @config = config @config_attributes = config_attributes end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Method called for methods missing
When a method is missing, it is expected that it is the name of a variable to be set on config (as long as it was defined in the config_attributes_array)
52 53 54 55 56 |
# File 'lib/sinclair/config_builder.rb', line 52 def method_missing(method_name, *args) return super unless method_included?(method_name) @config.instance_variable_set("@#{method_name}", *args) end |