class Sidekiq::Control::Worker::Param

Constants

TYPE_MAP

Attributes

name[R]
type[R]
value[R]

Public Class Methods

new(type, name=nil) click to toggle source
# File lib/sidekiq/control/worker/param.rb, line 13
def initialize(type, name=nil)
  @type = type
  @name = name.to_s
end

Public Instance Methods

optional?() click to toggle source
# File lib/sidekiq/control/worker/param.rb, line 32
def optional?
  !required?
end
required?() click to toggle source
# File lib/sidekiq/control/worker/param.rb, line 28
def required?
  @type == :req
end
type_name() click to toggle source
# File lib/sidekiq/control/worker/param.rb, line 24
def type_name
  TYPE_MAP[@type]
end
value=(value) click to toggle source
# File lib/sidekiq/control/worker/param.rb, line 18
def value=(value)
  raise ArgumentError if required? && value.nil?

  @value = value
end