Class: BackgroundQueue::Worker::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/background_queue/worker/config.rb

Constant Summary collapse

@@worker_path =
nil

Class Method Summary collapse

Class Method Details

.default_worker_pathObject



26
27
28
29
30
31
32
33
34
# File 'lib/background_queue/worker/config.rb', line 26

def self.default_worker_path
  if defined?(RAILS_ROOT)
    File.join(RAILS_ROOT, "lib", "bgq_workers")
  elsif defined?(Rails) 
    File.join(Rails.root, "lib", "bgq_workers")
  else
    raise "You must specify the BackgroundQueue::Worker::Config.worker_path"
  end
end

.secretObject



10
11
12
# File 'lib/background_queue/worker/config.rb', line 10

def self.secret
  @@secret
end

.secret=(auth) ⇒ Object



6
7
8
# File 'lib/background_queue/worker/config.rb', line 6

def self.secret=(auth)
  @@secret = auth
end

.worker_pathObject



18
19
20
21
22
23
24
# File 'lib/background_queue/worker/config.rb', line 18

def self.worker_path
  if @@worker_path.nil?
    default_worker_path
  else
    @@worker_path
  end
end

.worker_path=(path) ⇒ Object



14
15
16
# File 'lib/background_queue/worker/config.rb', line 14

def self.worker_path=(path)
  @@worker_path = path
end