Module: ActiveJob::Arguments

Extended by:
Arguments
Included in:
Arguments
Defined in:
activejob/lib/active_job/arguments.rb

Constant Summary collapse

TYPE_WHITELIST =

:nodoc:

[ NilClass, String, Integer, Float, BigDecimal, TrueClass, FalseClass ]

Instance Method Summary collapse

Instance Method Details

#deserialize(arguments) ⇒ Object

Deserializes a set of arguments. Whitelisted types are returned as-is. Arrays/Hashes are deserialized element by element. All other types are deserialized using GlobalID.


41
42
43
44
45
# File 'activejob/lib/active_job/arguments.rb', line 41

def deserialize(arguments)
  arguments.map { |argument| deserialize_argument(argument) }
rescue => e
  raise DeserializationError.new(e)
end

#serialize(arguments) ⇒ Object

Serializes a set of arguments. Whitelisted types are returned as-is. Arrays/Hashes are serialized element by element. All other types are serialized using GlobalID.


34
35
36
# File 'activejob/lib/active_job/arguments.rb', line 34

def serialize(arguments)
  arguments.map { |argument| serialize_argument(argument) }
end