Class: YTools::YReader
- Inherits:
-
Object
- Object
- YTools::YReader
- Defined in:
- lib/ytools/yreader.rb
Instance Method Summary collapse
Instance Method Details
#read(yaml_files) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ytools/yreader.rb', line 6 def read(yaml_files) root = {} yaml_files.each do |yaml_file| if File.exists?(yaml_file) yaml = YAML::load(File.read(yaml_file)) if !yaml.is_a?(Hash) raise PathError.new("The yaml file wasn't a hash!") end end end end |