Class: Mongoid::Railties::ActiveJobSerializers::BsonObjectIdSerializer
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
ActiveJob::Serializers::ObjectSerializer
|
|
Instance Chain:
self,
ActiveJob::Serializers::ObjectSerializer
|
|
Inherits: |
ActiveJob::Serializers::ObjectSerializer
|
Defined in: | lib/mongoid/railties/bson_object_id_serializer.rb |
Overview
This class provides serialization and deserialization of ::BSON::ObjectId
for ActiveJob.
It is important that this class is loaded only when ::Rails
is available since it depends on Rails’ ActiveJob::Serializers::ObjectSerializer.
Instance Method Summary
-
#deserialize(string) ⇒ BSON::ObjectId
Deserializes the argument back into a
::BSON::ObjectId
. -
#serialize(object)
Serializes the argument to be passed to the job.
-
#serialize?(argument) ⇒ Boolean
Returns whether the argument can be serialized by this serializer.
Instance Method Details
#deserialize(string) ⇒ BSON::ObjectId
Deserializes the argument back into a ::BSON::ObjectId
.
#serialize(object)
Serializes the argument to be passed to the job.
# File 'lib/mongoid/railties/bson_object_id_serializer.rb', line 24
def serialize(object) object.to_s end
#serialize?(argument) ⇒ Boolean
Returns whether the argument can be serialized by this serializer.
@param [ Object ] argument The argument to check.
@return [ true | false ] Whether the argument can be serialized.