Module: Sidekiq::Defer::JobRecord

Defined in:
lib/sidekiq/defer/api.rb

Instance Method Summary collapse

Instance Method Details

#display_argsObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/sidekiq/defer/api.rb', line 24

def display_args
  # Unwrap known wrappers so they show up in a human-friendly manner in the Web UI
  @display_args ||= case klass
                    when DELAYED_JOB_PATTERN
                      safe_load(args[0], args) do |_, _, arg, kwargs|
                        if !kwargs || kwargs.empty?
                          arg
                        else
                          [arg, kwargs]
                        end
                      end
                    else
                      super
                    end
end

#display_classObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/sidekiq/defer/api.rb', line 10

def display_class
  # Unwrap known wrappers so they show up in a human-friendly manner in the Web UI
  @display_class ||= self['display_class'] || begin
    case klass
    when DELAYED_JOB_PATTERN
      safe_load(args[0], klass) do |target, method, _|
        "#{target}.#{method}"
      end
    else
      super
    end
  end
end