Class: Jerakia::Datasource::File::Yaml

Inherits:
Object
  • Object
show all
Defined in:
lib/jerakia/datasource/file/yaml.rb

Constant Summary collapse

EXTENSION =
'yaml'

Class Method Summary collapse

Class Method Details

.convert(data) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/jerakia/datasource/file/yaml.rb', line 9

def convert(data)
  return {} if data.empty?
  begin
    YAML.load(data)
  rescue Psych::SyntaxError => e
    raise Jerakia::FileParseError, "Error parsing YAML document: #{e.message}"
  end
end