Module: Shoryuken::ActiveJob::CurrentAttributes::Serializer

Defined in:
lib/shoryuken/active_job/current_attributes.rb

Overview

Serializer for current attributes using ActiveJob::Arguments. Supports Symbols and GlobalID objects.

Class Method Summary collapse

Class Method Details

.deserialize(attrs) ⇒ Hash

Deserializes attributes hash from SQS message

Parameters:

  • attrs (Object)

    the serialized attributes

Returns:

  • (Hash)

    the deserialized attributes



43
44
45
# File 'lib/shoryuken/active_job/current_attributes.rb', line 43

def deserialize(attrs)
  ::ActiveJob::Arguments.deserialize([attrs]).first
end

.serialize(attrs) ⇒ Object

Serializes attributes hash for SQS message storage

Parameters:

  • attrs (Hash)

    the attributes to serialize

Returns:

  • (Object)

    the serialized attributes



35
36
37
# File 'lib/shoryuken/active_job/current_attributes.rb', line 35

def serialize(attrs)
  ::ActiveJob::Arguments.serialize([attrs]).first
end