Method: Filegen::DataSources::Yaml#initialize
- Defined in:
- lib/filegen/data_sources/yaml.rb
#initialize(file) ⇒ Yaml
Create data source
14 15 16 17 18 |
# File 'lib/filegen/data_sources/yaml.rb', line 14 def initialize(file) @source = HashWithIndifferentAccess.new(Psych.load_file(file)) rescue Errno::ENOENT raise Exceptions::YamlFileNotFound, JSON.dump(file: file) end |