Class: ReleaseHx::RHYML::Loader
- Inherits:
-
Object
- Object
- ReleaseHx::RHYML::Loader
show all
- Defined in:
- lib/releasehx/rhyml/loaders.rb
Class Method Summary
collapse
Class Method Details
.load_file(path) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/releasehx/rhyml/loaders.rb', line 9
def self.load_file path
ext = File.extname(path)
case ext
when '.yml', '.yaml'
SchemaGraphy::Loader.load_yaml_with_tags(path)
when '.json'
JSON.parse(File.read(path))
else
raise "Unsupported format: #{ext}"
end
end
|