Class: ActiveJob::Serializers::ModuleSerializer

Inherits:
ObjectSerializer show all
Defined in:
activejob/lib/active_job/serializers/module_serializer.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from ObjectSerializer

#serialize?

Methods included from Singleton

#duplicable?

Instance Method Details

#deserialize(hash) ⇒ Object


11
12
13
# File 'activejob/lib/active_job/serializers/module_serializer.rb', line 11

def deserialize(hash)
  hash["value"].constantize
end

#serialize(constant) ⇒ Object

Raises:


6
7
8
9
# File 'activejob/lib/active_job/serializers/module_serializer.rb', line 6

def serialize(constant)
  raise SerializationError, "Serializing an anonymous class is not supported" unless constant.name
  super("value" => constant.name)
end