Class: RightAws::Sqs::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/sqs/right_sqs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



282
283
284
# File 'lib/sqs/right_sqs.rb', line 282

def body
  @body
end

#idObject (readonly)

Returns the value of attribute id.



282
283
284
# File 'lib/sqs/right_sqs.rb', line 282

def id
  @id
end

#queueObject (readonly)

Returns the value of attribute queue.



282
283
284
# File 'lib/sqs/right_sqs.rb', line 282

def queue
  @queue
end

#received_atObject

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_atObject

Returns the value of attribute sent_at.



283
284
285
# File 'lib/sqs/right_sqs.rb', line 283

def sent_at
  @sent_at
end

#visibilityObject

Returns the value of attribute visibility.



282
283
284
# File 'lib/sqs/right_sqs.rb', line 282

def visibility
  @visibility
end

Instance Method Details

#deleteObject

Removes message from queue. Returns true.



308
309
310
# File 'lib/sqs/right_sqs.rb', line 308

def delete
  @queue.sqs.interface.delete_message(@queue.url, @id)
end

#to_sObject

Returns Message instance body.



295
296
297
# File 'lib/sqs/right_sqs.rb', line 295

def to_s
  @body
end