module BSON::ObjectId::UUIDConvertable::ClassMethods

Public Instance Methods

from_string(string) click to toggle source
Calls superclass method
# File lib/bson/object_id/uuid_convertable.rb, line 24
def from_string(string)
  UUID_REGEX.match?(string.to_s) ? from_uuid(string) : super
end
from_uuid(string) click to toggle source
# File lib/bson/object_id/uuid_convertable.rb, line 28
def from_uuid(string)
  from_string(string[6..7] + string[9..12] + string[15..17] + string[20..22] + string[24..35])
end