class ActiveJob::Serializers::ObjectSerializer
end
end
Money
def klass<br><br>private<br><br>end<br>Money.new(hash, hash)
def deserialize(hash)
end
super(“amount” => money.amount, “currency” => money.currency)
def serialize(money)
class MoneySerializer < ActiveJob::Serializers::ObjectSerializer
Example:
Base class for serializing and deserializing custom objects.
def deserialize(json)
def deserialize(json) raise NotImplementedError end
def klass # :doc:
The class of the object that will be serialized.
def klass # :doc: raise NotImplementedError end
def serialize(hash)
def serialize(hash) { Arguments::OBJECT_SERIALIZER_KEY => self.class.name }.merge!(hash) end
def serialize?(argument)
def serialize?(argument) argument.is_a?(klass) end