Class: Queuel::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/queuel/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(engine, credentials, init_queue = nil) ⇒ Client

Returns a new instance of Client.



4
5
6
7
8
# File 'lib/queuel/client.rb', line 4

def initialize(engine, credentials, init_queue = nil)
  self.engine = engine
  self.credentials = credentials
  self.given_queue = init_queue
end

Instance Method Details

#queueObject



20
21
22
23
# File 'lib/queuel/client.rb', line 20

def queue
  bare = (given_queue || Queuel.default_queue)
  bare.to_s unless bare.nil?
end

#with(change_queue = nil) ⇒ Object



16
17
18
# File 'lib/queuel/client.rb', line 16

def with(change_queue = nil)
  self.clone.tap { |client| client.given_queue = change_queue }
end