Class: BigDecimal
- Inherits:
-
Object
- Object
- BigDecimal
- Defined in:
- lib/mongo_odm/core_ext/conversions.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.type_cast(value) ⇒ Object
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
#to_mongo ⇒ Object
130 131 132 |
# File 'lib/mongo_odm/core_ext/conversions.rb', line 130 def to_mongo self.to_s end |