Module: Mongoid::Extensions::String::Checks
- Included in:
- String
- Defined in:
- lib/mongoid/extensions/string/checks.rb
Overview
This module has object checks in it.
Instance Attribute Summary collapse
-
#unconvertable_to_bson ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#mongoid_id? ⇒ true, false
Is the string a valid value for a Mongoid id?.
-
#unconvertable_to_bson? ⇒ true, false
Is the object not to be converted to bson on criteria creation?.
Instance Attribute Details
#unconvertable_to_bson ⇒ Object
:nodoc:
8 9 10 |
# File 'lib/mongoid/extensions/string/checks.rb', line 8 def unconvertable_to_bson @unconvertable_to_bson end |
Instance Method Details
#mongoid_id? ⇒ true, false
Is the string a valid value for a Mongoid id?
18 19 20 |
# File 'lib/mongoid/extensions/string/checks.rb', line 18 def mongoid_id? self =~ /^(|_)id$/ end |
#unconvertable_to_bson? ⇒ true, false
Is the object not to be converted to bson on criteria creation?
30 31 32 |
# File 'lib/mongoid/extensions/string/checks.rb', line 30 def unconvertable_to_bson? !!@unconvertable_to_bson end |