module Mongoid::Extensions::BigDecimal

Public Instance Methods

__to_inc__() click to toggle source

Convert the big decimal to an $inc-able value.

@example Convert the big decimal.

bd.__to_inc__

@return [ Float ] The big decimal as a float.

@since 3.0.3

# File lib/mongoid/extensions/big_decimal.rb, line 16
def __to_inc__
  to_f
end
mongoize() click to toggle source

Turn the object from the ruby type we deal with to a Mongo friendly type.

@example Mongoize the object.

object.mongoize

@return [ Object ] The object.

@since 3.0.0

# File lib/mongoid/extensions/big_decimal.rb, line 29
def mongoize
  to_s
end
numeric?() click to toggle source

Is the BigDecimal a number?

@example Is the object a number?.

object.numeric?

@return [ true ] Always true.

@since 6.0.0

# File lib/mongoid/extensions/big_decimal.rb, line 41
def numeric?
  true
end