Module: BSON::BigDecimal::ClassMethods
- Defined in:
- lib/bson/big_decimal.rb
Instance Method Summary collapse
-
#from_bson(buffer, **options) ⇒ BigDecimal | BSON::Decimal128
Deserialize the BigDecimal from raw BSON bytes.
Instance Method Details
#from_bson(buffer, **options) ⇒ BigDecimal | BSON::Decimal128
Deserialize the BigDecimal from raw BSON bytes. If the :mode option is set to BSON, this will return a BSON::Decimal128
60 61 62 63 64 65 66 67 |
# File 'lib/bson/big_decimal.rb', line 60 def from_bson(buffer, **) dec128 = Decimal128.from_bson(buffer, **) if [:mode] == :bson dec128 else dec128.to_d end end |