Class: Kronk::YamlParser

Inherits:
Object
  • Object
show all
Defined in:
lib/kronk/yaml_parser.rb

Overview

Simple yaml wrapper to support Kronk’s parser interface.

Class Method Summary collapse

Class Method Details

.parse(yaml) ⇒ Object

Wrapper for YAML.load



11
12
13
14
15
16
# File 'lib/kronk/yaml_parser.rb', line 11

def self.parse yaml
  YAML.load(yaml) || raise(ParserError, "unparsable YAML")

rescue ArgumentError
  raise ParserError, "unparsable YAML"
end