Class: GenesisRuby::Parsers::Json
- Defined in:
- lib/genesis_ruby/parsers/json.rb
Overview
JSON Document parser
Instance Attribute Summary
Attributes inherited from Base
#root_node_skipped, #structure
Instance Method Summary collapse
-
#parse_document(document) ⇒ Object
Parse received document.
Methods inherited from Base
Constructor Details
This class inherits a constructor from GenesisRuby::Parsers::Base
Instance Method Details
#parse_document(document) ⇒ Object
Parse received document
12 13 14 15 16 |
# File 'lib/genesis_ruby/parsers/json.rb', line 12 def parse_document(document) @structure = JSON.parse(document, symbolize_names: true) rescue StandardError => e raise ParserError, "Given JSON string can not be parsed! #{e.}" end |