Class: IronMQ::Queues
- Inherits:
-
Object
- Object
- IronMQ::Queues
- Defined in:
- lib/ironmq/queues.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#get(options = {}) ⇒ Object
options: :name => can specify an alternative queue name.
-
#initialize(client) ⇒ Queues
constructor
A new instance of Queues.
- #list(options = {}) ⇒ Object
- #path(options = {}) ⇒ Object
Constructor Details
#initialize(client) ⇒ Queues
Returns a new instance of Queues.
6 7 8 |
# File 'lib/ironmq/queues.rb', line 6 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/ironmq/queues.rb', line 4 def client @client end |
Instance Method Details
#get(options = {}) ⇒ Object
options:
:name => can specify an alternative queue name
27 28 29 30 |
# File 'lib/ironmq/queues.rb', line 27 def get(={}) res, status = @client.get("#{path()}/#{[:name]}") return Queue.new(self, res) end |
#list(options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ironmq/queues.rb', line 14 def list(={}) ret = [] res, status = @client.get("#{path()}", ) res.each do |q| #p q q = Queue.new(self, q) ret << q end ret end |
#path(options = {}) ⇒ Object
10 11 12 |
# File 'lib/ironmq/queues.rb', line 10 def path(={}) path = "/projects/#{@client.project_id}/queues" end |