spec/runners/gridfs.rb
def to_oid(value, id = nil)
        if id
          id
        elsif value.is_a?(BSON::ObjectId)
          value
        elsif value['$oid']
          BSON::ObjectId.from_string(value['$oid'])
        else
          BSON::ObjectId.new
        end
      end
# Convert an object id represented in json to a BSON::ObjectId.
# A new BSON::ObjectId is returned if the json document is empty.
#
# @param [ Object ] value The value to convert.
# @param [ Object ] id The id override.
#
# @return [ BSON::ObjectId ] The object id.
#
# @since 2.1.0
Convert an object id represented in json to a BSON::ObjectId.
A new BSON::ObjectId is returned if the json document is empty.
Convert an object id represented in json to a BSON :: ObjectId . A new BSON :: ObjectId is returned if the json document is empty .
def to_oid(value, id = nil)
        if id
          id
        elsif value.is_a?(BSON::ObjectId)
          value
        elsif value['$oid']
          BSON::ObjectId.from_string(value['$oid'])
        else
          BSON::ObjectId.new
        end
      end
def to_oid ( value , id = nil ) if id id elsif value . is_a? ( BSON :: ObjectId ) value elsif value [ '$oid' ] BSON :: ObjectId . from_string ( value [ '$oid' ] ) else BSON :: ObjectId . new end end
Convert an object id represented in json to a BSON::ObjectId.
Convert an object id represented in json to a BSON :: ObjectId .
The object id.
The object id .
 BSON::ObjectId 
value
id
id The id override.
id The id override .
since
None