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

#local_name, parse

Constructor Details

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

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

Parameters:

  • record (Krikri::OriginalRecord)

    a record whose properties can

  • root_path (String) (defaults to: '$')

    JsonPath that identifies the root path for

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