module MiniTools::Configuration
Used to build simple configuration objects.
“` class SimpleConfig
include MiniTools::Configuration allow :value_1, value_2 allow :value_3
end “`
Then we can set the values with
“` SimpleConfig.configure do |config|
config.value_1 = 'some-value' config.value_2 = 'another-value' config.value_3 = 'a-third-value'
end “`
and access the values with
“` SimpleConfig.config.value_1 # some-value “`
Public Class Methods
included(base)
click to toggle source
# File lib/mini_tools/configuration.rb, line 29 def self.included(base) base.extend ClassMethods end