Class: Krikri::JsonParser

Inherits:
Parser
  • Object
show all
Defined in:
lib/krikri/parsers/json_parser.rb

Overview

JsonParser

See Also:

Defined Under Namespace

Classes: Value

Instance Attribute Summary

Attributes inherited from Parser

#record, #root

Instance Method Summary collapse

Methods inherited from Parser

parse

Constructor Details

#initialize(record, root_path = '$') ⇒ JsonParser

be parsed by the parser instance. the desired parse root.

See Also:


14
15
16
17
# File 'lib/krikri/parsers/json_parser.rb', line 14

def initialize(record, root_path = '$')
  @root = Value.new(JsonPath.on(record.content, root_path).first)
  super(record)
end