Class: DataMapper::Query::Conditions::Operation
- Inherits:
-
Object
- Object
- DataMapper::Query::Conditions::Operation
- Defined in:
- lib/dm-core/query/conditions/operation.rb
Class Method Summary collapse
-
.new(slug, *operands) ⇒ AbstractOperation
Factory method to initialize an operation.
-
.slugs ⇒ Array
private
Return an Array of all the slugs for the operation classes.
Class Method Details
.new(slug, *operands) ⇒ AbstractOperation
Factory method to initialize an operation
19 20 21 22 23 |
# File 'lib/dm-core/query/conditions/operation.rb', line 19 def self.new(slug, *operands) raise ArgumentError, "No Operation class for #{slug.inspect} has been defined" unless (klass = operation_class(slug)) klass.new(*operands) end |
.slugs ⇒ Array
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return an Array of all the slugs for the operation classes
31 32 33 |
# File 'lib/dm-core/query/conditions/operation.rb', line 31 def self.slugs AbstractOperation.descendants.map(&:slug) end |