module BSON::BigDecimal::ClassMethods
Public Instance Methods
from_bson(bson)
click to toggle source
Deserialize an instance of a BigDecimal
from a BSON
double. @param [ BSON
] bson object from Mongo. @return [ BigDecimal
] The decoded BigDecimal
. @see bsonspec.org/#/specification
# File lib/logstash/outputs/bson/big_decimal.rb, line 46 def from_bson(bson) from_bson_double(bson.read(8)) end
Private Instance Methods
from_bson_double(double)
click to toggle source
# File lib/logstash/outputs/bson/big_decimal.rb, line 52 def from_bson_double(double) new(double.unpack(PACK).first.to_s) end