Class: Decanter::Parser::JsonParser

Inherits:
ValueParser show all
Defined in:
lib/decanter/parser/json_parser.rb

Class Method Summary collapse

Methods inherited from ValueParser

_parse

Methods included from Core

included

Class Method Details

.parse_json(val) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/decanter/parser/json_parser.rb', line 11

def self.parse_json(val)
  begin
    JSON.parse(val)
  rescue 
    raise Decanter::ParseError.new 'Invalid JSON string'
  end
end