Module: MiniTools::Configuration

Defined in:
lib/mini_tools/configuration.rb

Overview

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 “`

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



29
30
31
# File 'lib/mini_tools/configuration.rb', line 29

def self.included(base)
  base.extend ClassMethods
end