Module: BSON::Float::ClassMethods

Defined in:
lib/bson/float.rb

Overview

Since:

  • 2.0.0

Instance Method Summary collapse

Instance Method Details

#from_bson(buffer, **options) ⇒ Float

Deserialize an instance of a Float from a BSON double.

Parameters:

  • buffer (ByteBuffer)

    The byte buffer.

  • options (Hash)

    a customizable set of options

Options Hash (**options):

  • :mode (nil | :bson)

    Decoding mode to use.

Returns:

  • (Float)

    The decoded Float.

See Also:

Since:

  • 2.0.0



96
97
98
# File 'lib/bson/float.rb', line 96

def from_bson(buffer, **options)
  buffer.get_double
end