Method: BSON::Code.from_bson

Defined in:
lib/bson/code.rb

.from_bson(buffer, **options) ⇒ TrueClass, FalseClass

Deserialize code from BSON.

Parameters:

  • buffer (ByteBuffer)

    The byte buffer.

  • options (Hash)

    a customizable set of options

Options Hash (**options):

  • :mode (nil | :bson)

    Decoding mode to use.

Returns:

See Also:

Since:

  • 2.0.0



110
111
112
# File 'lib/bson/code.rb', line 110

def self.from_bson(buffer, **options)
  new(buffer.get_string)
end