Namespace

Methods

BSON::NilClass

Injects behaviour for encoding and decoding nil values to and from raw bytes as specified by the BSON spec.

@see bsonspec.org/#/specification

@since 2.0.0

Constants

BSON_TYPE

A nil is type 0x0A in the BSON spec.

@since 2.0.0

Public Instance Methods

to_bson(encoded = ''.force_encoding(BINARY)) click to toggle source

Get the nil as encoded BSON.

@example Get the nil as encoded BSON.

nil.to_bson

@return [ String ] An empty string.

@see bsonspec.org/#/specification

@since 2.0.0

# File lib/bson/nil_class.rb, line 40
def to_bson(encoded = ''.force_encoding(BINARY))
  encoded
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.