Class: ActiveJob::Serializers::ModuleSerializer

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

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from ObjectSerializer

#serialize?

Instance Method Details

#deserialize(hash) ⇒ Object



11
12
13
# File '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 '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