Class: Fog::Rackspace::Queues::Claims

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/rackspace/models/queues/claims.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#queueString

Returns The queue associated with the claim collection.

Returns:

  • (String)

    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

#allFog::Rackspace::Queues::Claims

Note:

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.

Returns:

Raises:



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