Class: Fog::Rackspace::Queues::Claims
- Inherits:
-
Collection
- Object
- Collection
- Fog::Rackspace::Queues::Claims
- Defined in:
- lib/fog/rackspace/models/queues/claims.rb
Instance Attribute Summary collapse
-
#queue ⇒ String
The queue associated with the claim collection.
Instance Method Summary collapse
-
#all ⇒ Fog::Rackspace::Queues::Claims
Returns list of claims as they are created.
-
#create(attributes = {}) ⇒ Fog::Rackspace::Queues::Claim
This operation claims a set of messages (up to the value of the limit parameter) from oldest to newest and skips any messages that are already claimed.
-
#get(claim_id) ⇒ Fog::Rackspace::Queues::Claim
This operation queries the specified claim for the specified queue.
Instance Attribute Details
#queue ⇒ String
Returns The queue associated with the claim collection.
12 13 14 |
# File 'lib/fog/rackspace/models/queues/claims.rb', line 12 def queue @queue end |
Instance Method Details
#all ⇒ Fog::Rackspace::Queues::Claims
The Rackspace Cloud does not currently provide a way to retrieve claims as such this list is maintained by fog. Claims are added to the claim collection
Returns list of claims as they are created.
22 23 24 |
# File 'lib/fog/rackspace/models/queues/claims.rb', line 22 def all self end |
#create(attributes = {}) ⇒ Fog::Rackspace::Queues::Claim
This operation claims a set of messages (up to the value of the limit parameter) from oldest to newest and skips any messages that are already claimed.
33 34 35 36 37 38 39 40 |
# File 'lib/fog/rackspace/models/queues/claims.rb', line 33 def create(attributes = {}) object = new(attributes) if object.save object else false end end |
#get(claim_id) ⇒ Fog::Rackspace::Queues::Claim
This operation queries the specified claim for the specified queue. Claims with malformed IDs or claims that are not found by ID are ignored.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/fog/rackspace/models/queues/claims.rb', line 50 def get(claim_id) requires :queue data = service.get_claim(queue.identity, claim_id).body new(data) rescue Fog::Rackspace::Queues::NotFound nil # HACK - This has been escalated to the Rackspace Queues team, as this # behavior is not normal HTTP behavior. rescue Fog::Rackspace::Queues::ServiceError nil end |