Class: DataMapper::Query::Conditions::Comparison

Class | DataMapper::Query::Conditions::Comparison
In: | lib/dm-core/query/conditions/comparison.rb
Parent: | Object

An abstract class which provides easy access to comparison operators

@example Creating a new comparison

      Comparison.new(:eql, MyClass.my_property, "value")

### Methods

comparison_class new slugs

### Public Class methods

comparison_class(slug)

Returns the comparison class identified by the given slug

@param [Symbol] slug

      See slug parameter for Comparison.new

@return [AbstractComparison, nil]

@api private

new(slug, subject, value)

Creates a new Comparison instance

The returned instance will be suitable for matching the given subject (property or relationship) against the value.

@param [Symbol] slug

      The type of comparison operator required. One of: :eql, :in, :gt,
      :gte, :lt, :lte, :regexp, :like.

@param [Property, Associations::Relationship]

      The subject of the comparison - the value of the subject will be
      matched against the given value parameter.

@param [Object] value

      The value for the comparison.

@return [DataMapper::Query::Conditions::AbstractComparison]

@example

      Comparison.new(:eql, MyClass.properties[:id], 1)

@api semipublic

slugs()

Returns an array of all slugs registered with Comparison

@return [Array<Symbol>]

@api private

[Validate]