Class: Fog::Rackspace::Queues::Messages
- Inherits:
-
Collection
- Object
- Array
- Collection
- Fog::Rackspace::Queues::Messages
- Defined in:
- lib/fog/rackspace/models/queues/messages.rb
Instance Attribute Summary collapse
-
#client_id ⇒ String
UUID for the client instance.
-
#echo ⇒ Boolean
Determines whether the API returns a client’s own messages.
-
#include_claimed ⇒ String
Determines whether the API returns claimed messages and unclaimed messages.
-
#limit ⇒ String
When more messages are available than can be returned in a single request, the client can pick up the next batch of messages by simply using the URI template parameters returned from the previous call in the “next” field.
-
#marker ⇒ String
Specifies an opaque string that the client can use to request the next batch of messages.
-
#queue ⇒ String
The name of the queue associated with the message.
Attributes inherited from Collection
Instance Method Summary collapse
-
#all ⇒ Fog::Rackspace::Queues::Messages
Returns list of messages.
-
#get(message_id) ⇒ Fog::Rackspace::Queues::Claim
Returns the specified message from the queue.
Methods inherited from Collection
#clear, #create, #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
#client_id ⇒ String
13 14 15 |
# File 'lib/fog/rackspace/models/queues/messages.rb', line 13 def client_id @client_id end |
#echo ⇒ Boolean
23 24 25 |
# File 'lib/fog/rackspace/models/queues/messages.rb', line 23 def echo @echo end |
#include_claimed ⇒ String
40 41 42 |
# File 'lib/fog/rackspace/models/queues/messages.rb', line 40 def include_claimed @include_claimed end |
#limit ⇒ String
29 30 31 |
# File 'lib/fog/rackspace/models/queues/messages.rb', line 29 def limit @limit end |
#marker ⇒ String
34 35 36 |
# File 'lib/fog/rackspace/models/queues/messages.rb', line 34 def marker @marker end |
#queue ⇒ String
17 18 19 |
# File 'lib/fog/rackspace/models/queues/messages.rb', line 17 def queue @queue end |
Instance Method Details
#all ⇒ Fog::Rackspace::Queues::Messages
Returns list of messages
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/fog/rackspace/models/queues/messages.rb', line 48 def all requires :client_id, :queue response = service.(client_id, queue.name, ) if response.status == 204 data = [] else data = response.body['messages'] end load(data) end |
#get(message_id) ⇒ Fog::Rackspace::Queues::Claim
Returns the specified message from the queue.
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/fog/rackspace/models/queues/messages.rb', line 66 def get() requires :client_id, :queue data = service.(client_id, queue.name, ).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 |