Sha256: 869ddc23c8a08eea0621209058bc2bf1c8b5cafaee2d02202619160efdbf119b
Contents?: true
Size: 512 Bytes
Versions: 21
Compression:
Stored size: 512 Bytes
Contents
class Code class Node class ChainedCall < Node def initialize(parsed) @first = Node::Statement.new(parsed.delete(:first)) @others = parsed .delete(:others) .map { |operator| Node::Statement.new(operator) } super(parsed) end def evaluate(**args) first = @first.evaluate(**args) @others.reduce(first) do |acc, element| element.evaluate(**args.merge(object: acc)) end end end end end
Version data entries
21 entries across 21 versions & 3 rubygems