lib/preval/node.rb in preval-0.3.0 vs lib/preval/node.rb in preval-0.4.0

- old
+ new

@@ -29,14 +29,14 @@ @type = type @body = body @literal = literal end - def dig(index, *args) + def [](index, *args) node = body[index] return nil unless node - args.any? ? node.dig(*args) : node + args.any? ? node[*args] : node end def join(delim = '') body.map(&:to_source).join(delim) end