Sha256: 851f4e2dec1a5639b45e91274df6ea2dbd730bcbb24d3da8b84ff806631dfd07

Contents?: true

Size: 989 Bytes

Versions: 3

Compression:

Stored size: 989 Bytes

Contents

# encoding: utf-8

module Axiom
  class Relation
    module Operation

      # A mixin for relations that combine their operands
      module Combination
        include Binary

        # Combine tuples together and yield the joined tuple
        #
        # @param [Header] header
        #   the header to use for the resulting tuples
        # @param [Tuple] left_tuple
        #   the left tuple to join with
        # @param [Enumerable<Tuple>] right_tuples
        #   the tuples to join to the left tuple
        #
        # @yield [tuple]
        #
        # @yieldparam [Tuple] tuple
        #   each joined tuple
        #
        # @return [undefined]
        #
        # @api private
        def self.combine_tuples(header, left_tuple, right_tuples)
          right_tuples.each do |right_tuple|
            yield left_tuple.join(header, right_tuple)
          end
        end

      end # module Combination
    end # module Operation
  end # class Relation
end # module Axiom

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
axiom-0.2.0 lib/axiom/relation/operation/combination.rb
axiom-0.1.1 lib/axiom/relation/operation/combination.rb
axiom-0.1.0 lib/axiom/relation/operation/combination.rb