Sha256: ab53b475e756ba631d032ea5ccc5399287e3d2b551eafdb955a69476d72925a4

Contents?: true

Size: 464 Bytes

Versions: 1

Compression:

Stored size: 464 Bytes

Contents

require_relative './enum'

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

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

Dentaku::AST::Function.register_class(:all, Dentaku::AST::All)

Version data entries

1 entries across 1 versions & 1 rubygems

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