Class: BigDecimal

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo_odm/core_ext/conversions.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) type_cast(value)



125
126
127
128
# File 'lib/mongo_odm/core_ext/conversions.rb', line 125

def self.type_cast(value)
  return nil if value.nil?
  value.is_a?(BigDecimal) ? value : new(value.to_s)
end

Instance Method Details

- (Object) to_mongo



130
131
132
# File 'lib/mongo_odm/core_ext/conversions.rb', line 130

def to_mongo
  self.to_s
end