Module: Humidifier::Reservoir::ParameterList

Defined in:
lib/humidifier/reservoir/parameter_list.rb

Overview

The list of parameters for a given stack parsed from the given filepath.

Class Method Summary collapse

Class Method Details

.from(filepath) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/humidifier/reservoir/parameter_list.rb', line 5

def self.from(filepath)
  loaded = YAML.load_file(filepath)
  return {} unless loaded

  loaded.each_with_object({}) do |(name, opts), params|
    opts = opts.map { |key, value| [key.to_sym, value] }.to_h
    params[name] = Parameter.new(opts)
  end
end