Class: Resque::Restriction::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/resque/restriction/config.rb

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



12
13
14
# File 'lib/resque/restriction/config.rb', line 12

def initialize
  @max_queue_peek = nil
end

Instance Method Details

#max_queue_peek(queue) ⇒ Object



26
27
28
# File 'lib/resque/restriction/config.rb', line 26

def max_queue_peek(queue)
  @max_queue_peek.respond_to?(:call) ? @max_queue_peek.call(queue) : @max_queue_peek
end

#max_queue_peek=(value_or_callable) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/resque/restriction/config.rb', line 16

def max_queue_peek=(value_or_callable)
  if value_or_callable.respond_to?(:call)
    @max_queue_peek = value_or_callable
  elsif value_or_callable.nil?
    @max_queue_peek = nil
  else
    @max_queue_peek = validated_max_queue_peek(value_or_callable)
  end
end