Class: RightAws::Sqs::Message
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
-
#received_at ⇒ Object
Returns the value of attribute received_at.
-
#sent_at ⇒ Object
Returns the value of attribute sent_at.
-
#visibility ⇒ Object
Returns the value of attribute visibility.
Instance Method Summary collapse
-
#delete ⇒ Object
Removes message from queue.
-
#initialize(queue, id = nil, body = nil, visibility = nil) ⇒ Message
constructor
A new instance of Message.
-
#to_s ⇒ Object
Returns
Message
instance body.
Constructor Details
#initialize(queue, id = nil, body = nil, visibility = nil) ⇒ Message
Returns a new instance of Message.
286 287 288 289 290 291 292 293 |
# File 'lib/sqs/right_sqs.rb', line 286 def initialize(queue, id=nil, body=nil, visibility=nil) @queue = queue @id = id @body = body @visibility = visibility @sent_at = nil @received_at = nil end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
283 284 285 |
# File 'lib/sqs/right_sqs.rb', line 283 def body @body end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
283 284 285 |
# File 'lib/sqs/right_sqs.rb', line 283 def id @id end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
283 284 285 |
# File 'lib/sqs/right_sqs.rb', line 283 def queue @queue end |
#received_at ⇒ Object
Returns the value of attribute received_at.
284 285 286 |
# File 'lib/sqs/right_sqs.rb', line 284 def received_at @received_at end |
#sent_at ⇒ Object
Returns the value of attribute sent_at.
284 285 286 |
# File 'lib/sqs/right_sqs.rb', line 284 def sent_at @sent_at end |
#visibility ⇒ Object
Returns the value of attribute visibility.
283 284 285 |
# File 'lib/sqs/right_sqs.rb', line 283 def visibility @visibility end |
Instance Method Details
#delete ⇒ Object
Removes message from queue. Returns true
.
309 310 311 |
# File 'lib/sqs/right_sqs.rb', line 309 def delete @queue.sqs.interface.(@queue.url, @id) end |
#to_s ⇒ Object
Returns Message
instance body.
296 297 298 |
# File 'lib/sqs/right_sqs.rb', line 296 def to_s @body end |