Sha256: f303e2dc37c4b9c66d88e44061802e7d16b1554ce69dc9352b3eac87855d35cd

Contents?: true

Size: 464 Bytes

Versions: 1

Compression:

Stored size: 464 Bytes

Contents

require_relative './enum'

module Dentaku
  module AST
    class Any < Enum
      def value(context = {})
        collection      = Array(@args[0].value(context))
        item_identifier = @args[1].identifier
        expression      = @args[2]

        collection.any? do |item_value|
          mapped_value(expression, context, item_identifier => item_value)
        end
      end
    end
  end
end

Dentaku::AST::Function.register_class(:any, Dentaku::AST::Any)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dentaku-3.5.4 lib/dentaku/ast/functions/any.rb