module BSON::Symbol

def as_extended_json(**_options)

Returns:
  • (Hash) - The extended json representation.
def as_extended_json(**_options)
  { "$symbol" => to_s }
end

def bson_type

Other tags:
    Since: - 4.0.0

Other tags:
    See: http://bsonspec.org/#/specification -

Returns:
  • (String) - The single byte BSON type.

Other tags:
    Example: Get the BSON type for the symbol. -
def bson_type
  String::BSON_TYPE
end

def to_bson(buffer = ByteBuffer.new)

Other tags:
    Since: - 2.0.0

Other tags:
    See: http://bsonspec.org/#/specification -

Returns:
  • (BSON::ByteBuffer) - The buffer with the encoded object.

Other tags:
    Example: Get the symbol as encoded BSON. -
def to_bson(buffer = ByteBuffer.new)
  buffer.put_symbol(self)
end

def to_bson_key

Other tags:
    Since: - 2.0.0

Other tags:
    See: http://bsonspec.org/#/specification -

Returns:
  • (String) - The encoded symbol as a BSON key.

Other tags:
    Example: Get the symbol as a key name. -
def to_bson_key
  self
end

def to_bson_normalized_key

Other tags:
    Since: - 3.0.0

Returns:
  • (String) - The symbol as a non interned string.

Other tags:
    Example: Convert the symbol to a normalized key. -
def to_bson_normalized_key
  to_s
end