Class: Mongoid::StringifiedSymbol
- Inherits:
-
Object
- Object
- Mongoid::StringifiedSymbol
- Defined in:
- lib/rocket_job/extensions/mongoid/stringified_symbol.rb
Class Method Summary collapse
-
.demongoize(object) ⇒ Symbol
private
Convert the object from its mongo friendly ruby type to this type.
- .evolve(object) ⇒ Object private
-
.mongoize(object) ⇒ Symbol
private
Turn the object from the ruby type we deal with to a Mongo friendly type.
Class Method Details
.demongoize(object) ⇒ Symbol
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.
Convert the object from its mongo friendly ruby type to this type.
17 18 19 20 21 22 23 |
# File 'lib/rocket_job/extensions/mongoid/stringified_symbol.rb', line 17 def demongoize(object) if object.nil? object else object.to_s.to_sym end end |
.evolve(object) ⇒ 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.
45 46 47 |
# File 'lib/rocket_job/extensions/mongoid/stringified_symbol.rb', line 45 def evolve(object) mongoize(object) end |
.mongoize(object) ⇒ Symbol
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.
Turn the object from the ruby type we deal with to a Mongo friendly type.
36 37 38 39 40 41 42 |
# File 'lib/rocket_job/extensions/mongoid/stringified_symbol.rb', line 36 def mongoize(object) if object.nil? object else object.to_s end end |