Convert the object from its mongo friendly ruby type to this type.
@example Demongoize the object.
Object.demongoize(object)
@param [ Object ] object The object to demongoize.
@return [ Object ] The object.
@since 3.0.0
# File lib/mongoid/extensions/big_decimal.rb, line 42 def demongoize(object) if object object.numeric? ? ::BigDecimal.new(object.to_s) : object end end
Mongoize an object of any type to how it's stored in the db as a big decimal.
@example Mongoize the object.
BigDecimal.mongoize(123)
@param [ Object ] object The object to Mongoize
@return [ String ] The mongoized object.
@since 3.0.7
# File lib/mongoid/extensions/big_decimal.rb, line 59 def mongoize(object) object ? object.to_s : object end
Generated with the Darkfish Rdoc Generator 2.