Parent

Methods

Class/Module Index [+]

Quicksearch

DataMapper::Query::Conditions::Operation

Public Class Methods

new(slug, *operands) click to toggle source

Factory method to initialize an operation

@example

operation = Operation.new(:and, comparison)

@param [Symbol] slug

the identifier for the operation class

@param [Array] *operands

the operands to initialize the operation with

@return [AbstractOperation]

the operation matching the slug

@api semipublic

# File lib/dm-core/query/conditions/operation.rb, line 19
def self.new(slug, *operands)
  if klass = operation_class(slug)
    klass.new(*operands)
  else
    raise ArgumentError, "No Operation class for #{slug.inspect} has been defined"
  end
end
slugs() click to toggle source

Return an Array of all the slugs for the operation classes

@return [Array]

the slugs of all the operation classes

@api private

# File lib/dm-core/query/conditions/operation.rb, line 33
def self.slugs
  AbstractOperation.descendants.map { |operation_class| operation_class.slug }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.