class BSON::ObjectId

def to_s

Other tags:
    Since: - 2.0.0

Returns:
  • (String) - The object id as a string.

Other tags:
    Example: Get the object id as a string. -
def to_s
  generate_data.to_hex_string.force_encoding(UTF8)
end