method

serialize_argument

Importance_0
v5.1.7 - Show latest stable - 0 notes - Class: Arguments
serialize_argument(argument) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activejob/lib/active_job/arguments.rb, line 53
      def serialize_argument(argument)
        case argument
        when *TYPE_WHITELIST
          argument
        when GlobalID::Identification
          convert_to_global_id_hash(argument)
        when Array
          argument.map { |arg| serialize_argument(arg) }
        when ActiveSupport::HashWithIndifferentAccess
          result = serialize_hash(argument)
          result[WITH_INDIFFERENT_ACCESS_KEY] = serialize_argument(true)
          result
        when Hash
          symbol_keys = argument.each_key.grep(Symbol).map(&:to_s)
          result = serialize_hash(argument)
          result[SYMBOL_KEYS_KEY] = symbol_keys
          result
        else
          raise SerializationError.new("Unsupported argument type: #{argument.class.name}")
        end
      end
Register or log in to add new notes.