Module: Mongoid::Criteria::Queryable::Extensions::String::ClassMethods
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Extended In:
| |
| Defined in: | lib/mongoid/criteria/queryable/extensions/string.rb |
Instance Method Summary
-
#__expr_part__(key, value, negating = false) ⇒ Hash
Get the value as a expression.
-
#evolve(object) ⇒ String
Evolves the string into a MongoDB friendly value - in this case a string.
-
#__regexp?(object) ⇒ Boolean
private
Returns whether the object is Regexp-like.
Instance Method Details
#__expr_part__(key, value, negating = false) ⇒ Hash
Get the value as a expression.
# File 'lib/mongoid/criteria/queryable/extensions/string.rb', line 79
def __expr_part__(key, value, negating = false) if negating { key => { "$#{__regexp?(value) ? 'not' : 'ne'}" => value } } else { key => value } end end
#__regexp?(object) ⇒ Boolean (private)
Returns whether the object is Regexp-like.
#evolve(object) ⇒ String
Evolves the string into a MongoDB friendly value - in this case a string.