Class: Fog::Rackspace::Queues::Claims
- Inherits:
-
Collection
- Object
- Array
- 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.
Attributes inherited from 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.
Methods inherited from Collection
#clear, #destroy, #initialize, #inspect, #load, model, #model, #new, #reload, #table, #to_json
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Collection
Instance Attribute Details
#queue ⇒ String
Returns The queue associated with the claim collection.
13 14 15 |
# File 'lib/fog/rackspace/models/queues/claims.rb', line 13 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.
23 24 25 |
# File 'lib/fog/rackspace/models/queues/claims.rb', line 23 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.
34 35 36 37 38 39 40 41 |
# File 'lib/fog/rackspace/models/queues/claims.rb', line 34 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.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/fog/rackspace/models/queues/claims.rb', line 51 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 |