Module: RUUID::Mongoid::Extensions::UUID

Defined in:
lib/ruuid/mongoid/extensions/uuid.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#mongoizeBSON::Binary

Turn the object from the Ruby type we deal with to a Mongo-friendly type.

Returns:

  • (BSON::Binary)

    The mongoized object.



10
11
12
# File 'lib/ruuid/mongoid/extensions/uuid.rb', line 10

def mongoize
  BSON::Binary.new(data, :uuid)
end