Skip to content

Commit

Permalink
Fix method typo
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbuddy committed May 9, 2023
1 parent 9068f9b commit 2c7cea8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/jsonpath/enumerable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def each(context = @object, key = nil, pos = 0, &blk)
if node == @object
each(context, key, pos + 1, &blk)
else
handle_wildecard(node, "['#{expr}']", context, key, pos, &blk)
handle_wildcard(node, "['#{expr}']", context, key, pos, &blk)
end
when /^\[(.*)\]$/
handle_wildecard(node, expr, context, key, pos, &blk)
handle_wildcard(node, expr, context, key, pos, &blk)
when /\(.*\)/
keys = expr.gsub(/[()]/, '').split(',').map(&:strip)
new_context = filter_context(context, keys)
Expand Down Expand Up @@ -55,7 +55,7 @@ def filter_context(context, keys)
end
end

def handle_wildecard(node, expr, _context, _key, pos, &blk)
def handle_wildcard(node, expr, _context, _key, pos, &blk)
expr[1, expr.size - 2].split(',').each do |sub_path|
case sub_path[0]
when '\'', '"'
Expand Down

0 comments on commit 2c7cea8

Please sign in to comment.