Sha256: cc1b214f34028c133f2cbacaa430a55690b24725933e55fb036a3216897b83c5

Contents?: true

Size: 760 Bytes

Versions: 5

Compression:

Stored size: 760 Bytes

Contents

module Alf
  module Algebra
    class Restrict
      include Operator
      include Relational
      include Unary

      signature do |s|
        s.argument :predicate, Predicate, Predicate.tautology
      end

      def heading
        @heading ||= operand.heading
      end

      def keys
        @keys ||= begin
          keys = operand.keys
          unless (cv = predicate.constant_variables).empty?
            keys = keys.map{|k| k - cv }
          end
          keys
        end
      end

    private

      def _type_check(options)
        no_unknown!(predicate.free_variables - operand.attr_list)
      rescue NotSupportedError => ex
        raise ex if options[:strict]
      end

    end # class Restrict
  end # module Algebra
end # module Alf

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alf-core-0.16.3 lib/alf/algebra/operator/restrict.rb
alf-core-0.16.2 lib/alf/algebra/operator/restrict.rb
alf-core-0.16.1 lib/alf/algebra/operator/restrict.rb
alf-core-0.16.0 lib/alf/algebra/operator/restrict.rb
alf-core-0.15.0 lib/alf/algebra/operator/restrict.rb