Class: RightAws::Sqs::Message
- Inherits:
-
Object
- Object
- RightAws::Sqs::Message
- Defined in:
- lib/sqs/right_sqs.rb
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.
285 286 287 288 289 290 291 292 |
# File 'lib/sqs/right_sqs.rb', line 285 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.
282 283 284 |
# File 'lib/sqs/right_sqs.rb', line 282 def body @body end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
282 283 284 |
# File 'lib/sqs/right_sqs.rb', line 282 def id @id end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
282 283 284 |
# File 'lib/sqs/right_sqs.rb', line 282 def queue @queue end |
#received_at ⇒ Object
Returns the value of attribute received_at.
283 284 285 |
# File 'lib/sqs/right_sqs.rb', line 283 def received_at @received_at end |
#sent_at ⇒ Object
Returns the value of attribute sent_at.
283 284 285 |
# File 'lib/sqs/right_sqs.rb', line 283 def sent_at @sent_at end |
#visibility ⇒ Object
Returns the value of attribute visibility.
282 283 284 |
# File 'lib/sqs/right_sqs.rb', line 282 def visibility @visibility end |
Instance Method Details
#delete ⇒ Object
Removes message from queue. Returns true
.
308 309 310 |
# File 'lib/sqs/right_sqs.rb', line 308 def delete @queue.sqs.interface.(@queue.url, @id) end |
#to_s ⇒ Object
Returns Message
instance body.
295 296 297 |
# File 'lib/sqs/right_sqs.rb', line 295 def to_s @body end |