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
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
Generated with the Darkfish Rdoc Generator 2.