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:



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

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.



18
19
20
# File 'lib/yarrow/configuration.rb', line 18

def load_defaults
  load(File.join(File.dirname(__FILE__), 'defaults.yml'))
end