Class: Yarrow::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/yarrow/configuration.rb

Class Method Summary collapse

Class Method Details

.load(file) ⇒ Yarrow::Config

Loads a configuration object from the given YAML file.

Parameters:

  • path (String)

    to YAML file

Returns:



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_defaultsYarrow::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.

Parameters:



9
10
11
# File 'lib/yarrow/configuration.rb', line 9

def merge(config)
  instance.deep_merge!(config)
end