module Sidekiq::Control::Web::Helpers

Public Instance Methods

display_params(params) click to toggle source
# File lib/sidekiq/control/web/helpers.rb, line 15
def display_params(params)
  params.map(&:name).reject { |n| n.start_with?('_') || n.empty? }.tap do |p|
    return 'None' if p.empty?
  end.join(', ')
end
get_job_params(job, params) click to toggle source
# File lib/sidekiq/control/web/helpers.rb, line 21
def get_job_params(job, params)
  return [] if params[:perform].nil?

  ParamsParser.values(job, params[:perform])
end
url_path(path) click to toggle source
# File lib/sidekiq/control/web/helpers.rb, line 11
def url_path(path)
  "#{root_path}#{path.sub(%r{^/}, '')}"
end

Private Instance Methods

to_attributes(data) click to toggle source
# File lib/sidekiq/control/web/helpers.rb, line 29
def to_attributes(data)
  # add a space before attributes since this is called without a space between the tag name and the attributes.
  " #{data.map { |k, v| "#{k}=\"#{v.is_a?(Array) ? v.join(' ') : v}\"" }.join(' ')}" unless data.empty?
end