123456789_123456789_123456789_123456789_123456789_

Class: ActiveJob::Serializers::SymbolSerializer

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: ActiveJob::Serializers::ObjectSerializer
Defined in: activejob/lib/active_job/serializers/symbol_serializer.rb

Class Method Summary

ObjectSerializer - Inherited

Instance Attribute Summary

ObjectSerializer - Inherited

#deserialize

Deserializes an argument from a JSON primitive type.

#serialize?

Determines if an argument should be serialized by a serializer.

::Singleton - Included

#duplicable?

::Singleton instances are not duplicable:

Instance Method Summary

ObjectSerializer - Inherited

#klass

The class of the object that will be serialized.

#serialize

Serializes an argument to a JSON primitive type.

Constructor Details

This class inherits a constructor from ActiveJob::Serializers::ObjectSerializer

Instance Method Details

#deserialize(argument)

[ GitHub ]

  
# File 'activejob/lib/active_job/serializers/symbol_serializer.rb', line 10

def deserialize(argument)
  argument["value"].to_sym
end

#klass

[ GitHub ]

  
# File 'activejob/lib/active_job/serializers/symbol_serializer.rb', line 14

def klass
  Symbol
end

#serialize(argument)

[ GitHub ]

  
# File 'activejob/lib/active_job/serializers/symbol_serializer.rb', line 6

def serialize(argument)
  super("value" => argument.name)
end