Class: Grenache::Configuration
- Inherits:
-
BaseConfiguration
- Object
- BaseConfiguration
- Grenache::Configuration
- Defined in:
- lib/grenache/configurable.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Configuration
constructor
A new instance of Configuration.
Methods inherited from BaseConfiguration
Constructor Details
#initialize(params = {}) ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/grenache/configurable.rb', line 18 def initialize(params = {}) @values = self.class.default.values.clone params.each do |k, v| @values[k.to_s] = v end # sanitize urls if not @values["grape_address"].end_with?("/") @values["grape_address"] = @values["grape_address"] + "/" end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Grenache::BaseConfiguration
Class Method Details
.default ⇒ Object
35 36 37 |
# File 'lib/grenache/configurable.rb', line 35 def self.default @defaults ||= BaseConfiguration.new end |
.set_default {|default| ... } ⇒ Object
31 32 33 |
# File 'lib/grenache/configurable.rb', line 31 def self.set_default &block yield default end |