Sha256: e3c511dfe92676714caf1ba48a054673fe54cbb2b99082e08261154f388066af

Contents?: true

Size: 500 Bytes

Versions: 2

Compression:

Stored size: 500 Bytes

Contents

module Alf
  module Operator::Relational
    class Restrict < Alf::Operator()
      include Operator::Relational, Operator::Unary
      
      signature do |s|
        s.argument :predicate, TuplePredicate, "true"
      end
      
      protected 
    
      # (see Operator#_each)
      def _each
        handle = TupleHandle.new
        each_input_tuple{|t| yield(t) if @predicate.evaluate(handle.set(t)) }
      end
  
    end # class Restrict
  end # module Operator::Relational
end # module Alf

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alf-0.10.1 lib/alf/operator/relational/restrict.rb
alf-0.10.0 lib/alf/operator/relational/restrict.rb