Sha256: bfdddd48396540faa86e820865c65b65b31da7fe4d24ef90bcd3ba3fe02d04f9

Contents?: true

Size: 1014 Bytes

Versions: 3

Compression:

Stored size: 1014 Bytes

Contents

# encoding: utf-8

module Axiom
  class Relation
    module Operation

      # A class representing a deletion from a relation
      class Deletion < Relation
        include Proxy

        # Initialize a Deletion
        #
        # @param [Array(Relation, Relation)] args
        #
        # @return [undefined]
        #
        # @api private
        def initialize(*args)
          @relation = Algebra::Difference.new(*args)
        end

        module Methods

          # Return a relation that represents a deletion from a relation
          #
          # @example
          #   deletion = relation.delete(other)
          #
          # @param [Enumerable] other
          #
          # @return [Deletion]
          #
          # @api public
          def delete(other)
            Deletion.new(self, coerce(other))
          end

        end # module Methods

        Relation.class_eval { include Methods }

      end # class Deletion
    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/deletion.rb
axiom-0.1.1 lib/axiom/relation/operation/deletion.rb
axiom-0.1.0 lib/axiom/relation/operation/deletion.rb