Class DataMapper::Query::Conditions::AbstractOperation
In: lib/dm-core/query/conditions/operation.rb
Parent: Object

Methods

&   +   -   <<   clear   descendants   difference   each   empty?   first   inherited   intersection   merge   minimize   negated?   new   one?   slug   slug   sorted_operands   to_s   union   valid?   |  

Included Modules

DataMapper::Assertions Enumerable

External Aliases

operands -> children

Attributes

operands  [R]  Returns the child operations and comparisons

@return [Set<AbstractOperation, AbstractComparison, Array>]

  the set of operations and comparisons

@api semipublic

parent  [RW]  Returns the parent operation

@return [AbstractOperation]

  the parent operation

@api semipublic

Public Class methods

Returns the classes that inherit from AbstractComparison

@return [Set]

  the descendant classes

@api private

Hook executed when inheriting from AbstractComparison

@return [undefined]

@api private

Initialize an operation

@param [Array<AbstractOperation, AbstractComparison, Array>] *operands

  the operands to include in the operation

@return [AbstractOperation]

  the operation

@api semipublic

Get and set the slug for the operation class

@param [Symbol] slug

  optionally set the slug for the operation class

@return [Symbol]

  the slug for the operation class

@api semipublic

Public Instance methods

&(other)

Alias for intersection

+(other)

Alias for union

-(other)

Alias for difference

Add an operand to the operation

@param [AbstractOperation, AbstractComparison, Array] operand

  the operand to add

@return [self]

  the operation

@api semipublic

Clear the operands

@return [self]

  the operation

@api semipublic

Return the difference of the operation and another operand

@param [AbstractOperation] other

  the operand to not match

@return [AndOperation]

  the intersection of the operation and operand

@api semipublic

Iterate through each operand in the operation

@yield [operand]

  yields to each operand

@yieldparam [AbstractOperation, AbstractComparison, Array] operand

  each operand

@return [self]

  returns the operation

@api semipublic

Test to see if there are operands

@return [Boolean]

  returns true if there are operands

@api semipublic

Get the first operand

@return [AbstractOperation, AbstractComparison, Array]

  returns the first operand

@api semipublic

Return the intersection of the operation and another operand

@param [AbstractOperation] other

  the operand to intersect with

@return [AndOperation]

  the intersection of the operation and operand

@api semipublic

Add operands to the operation

@param [each] operands

  the operands to add

@return [self]

  the operation

@api semipublic

Minimize the operation

@return [self]

  the minimized operation

@api semipublic

Test if the operation is negated

Defaults to return false.

@return [Boolean]

  true if the operation is negated, false if not

@api private

Test to see if there is one operand

@return [Boolean]

  true if there is only one operand

@api semipublic

Return the comparison class slug

@return [Symbol]

  the comparison class slug

@api private

Return a list of operands in predictable order

@return [Array<AbstractOperation, AbstractComparison, Array>]

  list of operands sorted in deterministic order

@api private

Return the string representation of the operation

@return [String]

  the string representation of the operation

@api semipublic

Return the union with another operand

@param [AbstractOperation] other

  the operand to union with

@return [OrOperation]

  the union of the operation and operand

@api semipublic

Test if the operation is valid

@return [Boolean]

  true if the operation is valid, false if not

@api semipublic

|(other)

Alias for union

[Validate]