Sha256: 3d31553b29ae0aded1c49cfdc1d59f7b23533258f9fce49d5a8e60b1fbde82ae

Contents?: true

Size: 1.39 KB

Versions: 3

Compression:

Stored size: 1.39 KB

Contents

# encoding: utf-8

module Axiom
  class Function
    class Predicate

      # A predicate representing an equality test between operands
      class Equality < Predicate
        include Comparable

        # Return the Equality operation
        #
        # @example
        #   Equality.operation  # => :==
        #
        # @return [Symbol]
        #
        # @api public
        def self.operation
          :==
        end

        # Return the inverse predicate class
        #
        # @example
        #   Equality.inverse  # => Inequality
        #
        # @return [Class<Inequality>]
        #
        # @api public
        def self.inverse
          Inequality
        end

        # Return the reverse predicate class
        #
        # @example
        #   Equality.reverse  # => Equality
        #
        # @return [self]
        #
        # @api public
        def self.reverse
          self
        end

        module Methods

          # Compare the left to see if it is equal to the right
          #
          # @example
          #   equality = expression.eq(other)
          #
          # @param [Function] other
          #
          # @return [Equality]
          #
          # @api public
          def eq(other)
            Equality.new(self, other)
          end

        end # module Methods
      end # class Equality
    end # class Predicate
  end # class Function
end # module Axiom

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
axiom-0.2.0 lib/axiom/function/predicate/equality.rb
axiom-0.1.1 lib/axiom/function/predicate/equality.rb
axiom-0.1.0 lib/axiom/function/predicate/equality.rb