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")
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