Class: Yarrow::Configuration
- Inherits:
-
Object
- Object
- Yarrow::Configuration
- Defined in:
- lib/yarrow/configuration.rb
Class Method Summary collapse
-
.load(file) ⇒ Yarrow::Config
Loads a configuration object from the given YAML file.
-
.load_defaults ⇒ Yarrow::Configuration
Yarrow is distributed with a ‘defaults.yml` which provides minimum boostrap configuration and default settings for various internal classes.
-
.merge(config) ⇒ Object
Merges the given configuration or hash-like object with the registered global configuration.
Class Method Details
.load(file) ⇒ Yarrow::Config
Loads a configuration object from the given YAML file.
19 20 21 |
# File 'lib/yarrow/configuration.rb', line 19 def load(file) coerce_config_struct(YAML.load(File.read(file), symbolize_names: true)) end |
.load_defaults ⇒ Yarrow::Configuration
Yarrow is distributed with a ‘defaults.yml` which provides minimum boostrap configuration and default settings for various internal classes. Use this method to automatically load these defaults.
28 29 30 |
# File 'lib/yarrow/configuration.rb', line 28 def load_defaults load(File.join(File.dirname(__FILE__), 'defaults.yml')) end |
.merge(config) ⇒ Object
Merges the given configuration or hash-like object with the registered global configuration.
9 10 11 |
# File 'lib/yarrow/configuration.rb', line 9 def merge(config) instance.deep_merge!(config) end |