Sha256: b8ab95e5a8f870f72f015de700d33e329e0109805bc1e4b2840e520cb2085379

Contents?: true

Size: 654 Bytes

Versions: 5

Compression:

Stored size: 654 Bytes

Contents

module Alf
  module Algebra
    class Intersect
      include Operator
      include Relational
      include Binary

      signature do |s|
      end

      def heading
        @heading ||= left.heading + right.heading
      end

      def keys
        @keys ||= begin
          k1s, k2s = left.keys, right.keys
          k2s = k2s.reject{|k| k1s.any?{|l| k.superset?(l) } }
          k1s = k1s.reject{|k| k2s.any?{|l| k.superset?(l) } }
          k1s + k2s
        end
      end

    private

      def _type_check(options)
        same_heading!(left.heading, right.heading)
      end

    end # class Intersect
  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/intersect.rb
alf-core-0.16.2 lib/alf/algebra/operator/intersect.rb
alf-core-0.16.1 lib/alf/algebra/operator/intersect.rb
alf-core-0.16.0 lib/alf/algebra/operator/intersect.rb
alf-core-0.15.0 lib/alf/algebra/operator/intersect.rb