Sha256: bfb0f53feede0efeda35373ec0ec1c42834089c0b9bcc5c2e66b065b815df51b

Contents?: true

Size: 676 Bytes

Versions: 24

Compression:

Stored size: 676 Bytes

Contents

# frozen_string_literal: true

if defined?(ActiveJob::Base)
  ActiveJob::Base.class_eval do
    # Removes any reserved keywords that can't be passed along.
    #
    # @param arguments [...]
    #
    # @return [String, Numeric, Hash, Array, nil]
    #
    def remove_reserved_keywords(arguments)
      case arguments
      when String, Numeric
        arguments
      when Hash
        arguments.each_with_object({}) do |(key, value), obj|
          next if key.start_with?('_aj')

          obj[key] = remove_reserved_keywords(value)
        end
      when Array
        arguments.map do |arg|
          remove_reserved_keywords(arg)
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
remove_reserved_keywords_extension-0.1.0 lib/remove_reserved_keywords_extension.rb
remove_reserved_keywords_extension-1.0.0 lib/remove_reserved_keywords_extension.rb
remove_reserved_keywords_extensions-1.0.0 lib/remove_reserved_keywords_extension.rb
remove_reserved_keywords_extensions-1.0.0.pre.rc.2 lib/remove_reserved_keywords_extension.rb