Module: WaterDrop::Configurable
- Defined in:
- lib/waterdrop/configurable.rb,
lib/waterdrop/configurable/leaf.rb,
lib/waterdrop/configurable/node.rb
Overview
A simple dry-configuration API compatible module for defining settings with defaults and a constructor.
Defined Under Namespace
Modules: ClassMethods, InstanceMethods Classes: Leaf, Node
Class Method Summary collapse
-
.extended(base) ⇒ Object
Sets up all the class methods and inits the core root node.
-
.included(base) ⇒ Object
Sets up all the class and instance methods and inits the core root node.
Class Method Details
.extended(base) ⇒ Object
Sets up all the class methods and inits the core root node. Useful when only per class settings are needed as does not include instance methods
16 17 18 |
# File 'lib/waterdrop/configurable.rb', line 16 def extended(base) base.extend ClassMethods end |
.included(base) ⇒ Object
Sets up all the class and instance methods and inits the core root node
Needs to be used when per instance configuration is needed
25 26 27 28 |
# File 'lib/waterdrop/configurable.rb', line 25 def included(base) base.include InstanceMethods base.extend self end |