Class: Configuration
- Defined in:
- lib/madvertise/ext/config.rb
Overview
The Configuration class provides a simple interface to configuration stored inside of YAML files.
Defined Under Namespace
Modules: Helpers
Instance Method Summary collapse
-
#initialize(mode = :development) {|config| ... } ⇒ Configuration
constructor
Create a new Configuration object.
-
#load_mixins(path, mixins_to_use) ⇒ void
Load given mixins from
path
.
Methods inherited from Section
Methods inherited from Hash
Constructor Details
#initialize(mode = :development) {|config| ... } ⇒ Configuration
Create a new Configuration object.
95 96 97 98 |
# File 'lib/madvertise/ext/config.rb', line 95 def initialize(mode = :development) @mode = mode yield self if block_given? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Section
Instance Method Details
#load_mixins(path, mixins_to_use) ⇒ void
This method returns an undefined value.
Load given mixins from path
.
105 106 107 108 109 110 111 |
# File 'lib/madvertise/ext/config.rb', line 105 def load_mixins(path, mixins_to_use) mixins_to_use.map do |mixin_name| File.join(path, "#{mixin_name}.yml") end.each do |mixin_file| mixin(mixin_file) end end |