Method: Moped::BSON::ObjectId#to_s

Defined in:
lib/moped/bson/object_id.rb

#to_sString Also known as: to_str

Get the string representation of the object.

Examples:

Get the string representation.

object.to_s

Returns:

  • (String)

    The string representation.

Since:

  • 1.0.0



165
166
167
# File 'lib/moped/bson/object_id.rb', line 165

def to_s
  data.unpack("H*")[0].force_encoding(Moped::BSON::UTF8_ENCODING)
end