Class: Sqs::Message
- Inherits:
-
Object
- Object
- Sqs::Message
- Extended by:
- Forwardable
- Defined in:
- lib/sqs/message.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#body_md5 ⇒ Object
readonly
Returns the value of attribute body_md5.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
-
#receipt_handle ⇒ Object
readonly
Returns the value of attribute receipt_handle.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #destroy ⇒ Object
-
#initialize(queue, options) ⇒ Message
constructor
A new instance of Message.
-
#inspect ⇒ Object
:nodoc:.
Constructor Details
#initialize(queue, options) ⇒ Message
Returns a new instance of Message.
18 19 20 21 22 23 24 |
# File 'lib/sqs/message.rb', line 18 def initialize(queue, ) @queue = queue @id = [:id] @body = [:body] @body_md5 = [:body_md5] @receipt_handle = [:receipt_handle] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/sqs/message.rb', line 7 def body @body end |
#body_md5 ⇒ Object (readonly)
Returns the value of attribute body_md5.
7 8 9 |
# File 'lib/sqs/message.rb', line 7 def body_md5 @body_md5 end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/sqs/message.rb', line 7 def id @id end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
7 8 9 |
# File 'lib/sqs/message.rb', line 7 def queue @queue end |
#receipt_handle ⇒ Object (readonly)
Returns the value of attribute receipt_handle.
7 8 9 |
# File 'lib/sqs/message.rb', line 7 def receipt_handle @receipt_handle end |
Instance Method Details
#==(other) ⇒ Object
9 10 11 |
# File 'lib/sqs/message.rb', line 9 def ==(other) self.id == other.id and self.queue == other.queue end |
#destroy ⇒ Object
13 14 15 16 |
# File 'lib/sqs/message.rb', line 13 def destroy queue_request(:params => { "Action" => "DeleteMessage", "ReceiptHandle" => receipt_handle }) true end |
#inspect ⇒ Object
:nodoc:
26 27 28 |
# File 'lib/sqs/message.rb', line 26 def inspect #:nodoc: "#<#{self.class}:#{name}/#{id}>" end |