Sha256: 2d90199c935ceae0b160c514524425031808af09349821f92909eb243eb40fe1
Contents?: true
Size: 582 Bytes
Versions: 5
Compression:
Stored size: 582 Bytes
Contents
# frozen_string_literal: true require 'jsonpath' module TrajectPlus module Macros # Macros for extracting values from JSON documents module JSON # @param path [String] the jsonpath query expression # @param options [Hash] other options, may include :trim def extract_json(path, options = {}) lambda do |json, accumulator, _context| result = Array(JsonPath.on(json, path)) result = TrajectPlus::Extraction.apply_extraction_options(result, options) accumulator.concat(result) end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems