Module: Trusty::Utilities::Yaml::ClassMethods

Included in:
Trusty::Utilities::Yaml
Defined in:
lib/trusty/utilities/yaml.rb

Instance Method Summary collapse

Instance Method Details

#load_content(content, &block) ⇒ Object



15
16
17
# File 'lib/trusty/utilities/yaml.rb', line 15

def load_content(content, &block)
  YamlContext.render(content, &block)
end

#load_file(filename, paths = [], &block) ⇒ Object



8
9
10
11
12
13
# File 'lib/trusty/utilities/yaml.rb', line 8

def load_file(filename, paths = [], &block)
  # allow multiple filenames and use the first one that exists
  if path = PathFinder.find(filename, paths)
    load_content(File.read(path), &block)
  end
end