Class: Fog::Rackspace::Queues::Message
- Defined in:
- lib/fog/rackspace/models/queues/message.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
- #destroy ⇒ Object
- #identity ⇒ Object (also: #id)
- #save ⇒ Object
Methods inherited from Model
#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #ignore_attributes, #ignored_attributes
Methods included from Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#destroy ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/fog/rackspace/models/queues/message.rb', line 30 def destroy requires :identity, :queue = {} [:claim_id] = claim_id unless claim_id.nil? service.(queue.name, identity, ) true end |
#identity ⇒ Object Also known as: id
14 15 16 17 18 19 |
# File 'lib/fog/rackspace/models/queues/message.rb', line 14 def identity return nil unless href match = href.match(/(\/(\w+))*\??/) match ? match[-1] : nil end |
#save ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/fog/rackspace/models/queues/message.rb', line 22 def save requires :queue, :client_id, :body, :ttl raise "Message has already been created and may not be updated." unless identity.nil? data = service.(client_id, queue.name, body, ttl).body self.href = data['resources'][0] true end |