class ObjectSerializer
Ruby on Rails 8.1.2
Since v6.0.6Base 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
Inherits from
Includes
Methods (defined here)
- # deserialize
- # serialize
- # serialize?
- self. new
Used by
Subclasses (1)
Methods (inherited)
From Object (17)
- # acts_like?
- # blank?
- # deep_dup
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # presence
- # presence_in
- # present?
- # to_param
- # to_query
- # try
- # try!
- # with
- # with_options
From Singleton (1)
From ActiveSupport::NumericWithFormat (2)
- # to_formatted_s
- # to_fs