Method: Moped::BSON::ObjectId#to_json

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

#to_json(*args) ⇒ String

Convert the object to a JSON string.

Examples:

Convert to a JSON string.

obejct.to_json

Returns:

  • (String)

    The object as JSON.

Since:

  • 1.0.0



153
154
155
# File 'lib/moped/bson/object_id.rb', line 153

def to_json(*args)
  "{\"$oid\": \"#{to_s}\"}"
end