class EasySettings::YamlSource
Attributes
path[R]
Public Class Methods
new(path)
click to toggle source
# File lib/easy-settings/yaml_source.rb, line 7 def initialize(path) @path = path.to_s end
Public Instance Methods
load()
click to toggle source
# File lib/easy-settings/yaml_source.rb, line 11 def load result = File.exist?(path) ? YAML.load(ERB.new(IO.read(path)).result) : {} rescue StandardError => e raise "Error occurred while parsing #{path}: #{e.message}" end