Module: File::YAML
- Defined in:
- lib/ruuuby/class/io/file.rb
Overview
Class Method Summary collapse
Class Method Details
.read(path) ⇒ Hash
155 156 157 158 |
# File 'lib/ruuuby/class/io/file.rb', line 155 def self.read(path) πstrβ('path', path) ::YAML.load_file(path) end |
.read!(path, expected_sections) ⇒ Hash
166 167 168 169 170 171 172 173 174 175 |
# File 'lib/ruuuby/class/io/file.rb', line 166 def self.read!(path, expected_sections) πstrβ('path', path) πaryβ('expected_sections', expected_sections) data = ::YAML.load_file(path) if (data.keys).ββ(expected_sections) return data else π ::RuntimeError.new("| c{File::YAML}-> m{read!} did not find sections{#{expected_sections.to_s}} at path{#{path.to_s}} |") end end |