Module: ActiveJob::QueueName::ClassMethods

Defined in:
lib/active_job/queue_name.rb

Instance Method Summary collapse

Instance Method Details

#queue_as(part_name = nil, &block) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/active_job/queue_name.rb', line 9

def queue_as(part_name=nil, &block)
  if block_given?
    self.queue_name = block
  else
    self.queue_name = queue_name_from_part(part_name)
  end
end

#queue_name_from_part(part_name) ⇒ Object

:nodoc:



17
18
19
20
21
# File 'lib/active_job/queue_name.rb', line 17

def queue_name_from_part(part_name) #:nodoc:
  queue_name = part_name.to_s.presence || default_queue_name
  name_parts = [queue_name_prefix.presence, queue_name]
  name_parts.compact.join('_')
end