Method: BSON::ObjectId.repair
- Defined in:
- lib/bson/object_id.rb
.repair(object) ⇒ String
Executes the provided block only if the size of the provided object is
-
Used in legacy id repairs.
353 354 355 356 357 |
# File 'lib/bson/object_id.rb', line 353 def repair(object) raise Error::InvalidObjectId, "#{object.inspect} is not a valid object id." if object.size != 12 block_given? ? yield(object) : object end |