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) ⇒ Object
TODO: document.
-
.operation_class(slug) ⇒ Object
TODO: document.
-
.slugs ⇒ Object
private
TODO: document.
Class Method Details
.new(slug, *operands) ⇒ Object
TODO: document
9 10 11 12 13 14 15 |
# File 'lib/dm-core/query/conditions/operation.rb', line 9 def self.new(slug, *operands) if klass = operation_class(slug) klass.new(*operands) else raise "No Operation class for `#{slug.inspect}' has been defined" end end |
.operation_class(slug) ⇒ Object
TODO: document
19 20 21 |
# File 'lib/dm-core/query/conditions/operation.rb', line 19 def self.operation_class(slug) operation_classes[slug] ||= AbstractOperation.descendants.detect { |operation_class| operation_class.slug == slug } end |
.slugs ⇒ Object
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.
TODO: document
25 26 27 |
# File 'lib/dm-core/query/conditions/operation.rb', line 25 def self.slugs @slugs ||= AbstractOperation.descendants.map { |operation_class| operation_class.slug } end |