lib/jsonpath.rb in jsonpath-0.9.2 vs lib/jsonpath.rb in jsonpath-0.9.3

- old
+ new

@@ -1,16 +1,18 @@ +# frozen_string_literal: true + require 'strscan' require 'multi_json' require 'jsonpath/proxy' require 'jsonpath/enumerable' require 'jsonpath/version' require 'jsonpath/parser' # JsonPath: initializes the class with a given JsonPath and parses that path # into a token array. class JsonPath - PATH_ALL = '$..*'.freeze + PATH_ALL = '$..*' attr_accessor :path def initialize(path, opts = {}) @opts = opts @@ -71,10 +73,10 @@ def enum_on(obj_or_str, mode = nil) JsonPath::Enumerable.new(self, self.class.process_object(obj_or_str), mode, @opts) end - alias_method :[], :enum_on + alias [] enum_on def self.on(obj_or_str, path, opts = {}) new(path, opts).on(process_object(obj_or_str)) end