lib/dentaku/ast/functions/all.rb in dentaku-3.4.2 vs lib/dentaku/ast/functions/all.rb in dentaku-3.5.0

- old
+ new

@@ -1,28 +1,15 @@ -require_relative '../function' -require_relative '../../exceptions' +require_relative './enum' module Dentaku module AST - class All < Function - def self.min_param_count - 3 - end - - def self.max_param_count - 3 - end - - def deferred_args - [1, 2] - end - + class All < Enum def value(context = {}) - collection = @args[0].value(context) + collection = Array(@args[0].value(context)) item_identifier = @args[1].identifier expression = @args[2] - Array(collection).all? do |item_value| + collection.all? do |item_value| expression.value( context.merge( FlatHash.from_hash_with_intermediates(item_identifier => item_value) ) )