Base
class for serializing and deserializing custom objects.
Example:
class MoneySerializer < ActiveJob::Serializers::ObjectSerializer
def serialize(money)
super("amount" => money.amount, "currency" => money.currency)
end
def deserialize(hash)
Money.new(hash["amount"], hash["currency"])
end
def klass
Money
end
end
Methods
- D
- K
- N
- S
Included Modules
Class Public methods
new() Link
Instance Public methods
deserialize(hash) Link
Deserializes an argument from a JSON primitive type.
klass() Link
The class of the object that will be serialized.
serialize(hash) Link
Serializes an argument to a JSON primitive type.