Module: ActiveJob::Arguments
Constant Summary collapse
- TYPE_WHITELIST =
[ NilClass, Fixnum, Float, String, TrueClass, FalseClass, Bignum ]
Instance Method Summary collapse
-
#deserialize(arguments) ⇒ Object
Deserializes a set of arguments.
-
#serialize(arguments) ⇒ Object
Serializes a set of arguments.
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.
39 40 41 42 43 |
# File 'lib/active_job/arguments.rb', line 39 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.
32 33 34 |
# File 'lib/active_job/arguments.rb', line 32 def serialize(arguments) arguments.map { |argument| serialize_argument(argument) } end |