Class: RightAws::SqsGen2::Message

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue, id = nil, rh = nil, body = nil, visibility = nil, attributes = nil) ⇒ Message

Returns a new instance of Message.



310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/sqs/right_sqs_gen2.rb', line 310

def initialize(queue, id=nil, rh = nil, body=nil, visibility=nil, attributes=nil)
  @queue       = queue
  @id          = id
  @receipt_handle = rh 
  @body        = body
  @visibility  = visibility
  @attributes  = attributes
  @sent_at     = nil
  @received_at = nil
  @send_checksum = nil
  @receive_checksum = nil
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



307
308
309
# File 'lib/sqs/right_sqs_gen2.rb', line 307

def attributes
  @attributes
end

#bodyObject (readonly)

Returns the value of attribute body.



307
308
309
# File 'lib/sqs/right_sqs_gen2.rb', line 307

def body
  @body
end

#idObject (readonly)

Returns the value of attribute id.



307
308
309
# File 'lib/sqs/right_sqs_gen2.rb', line 307

def id
  @id
end

#queueObject (readonly)

Returns the value of attribute queue.



307
308
309
# File 'lib/sqs/right_sqs_gen2.rb', line 307

def queue
  @queue
end

#receipt_handleObject (readonly)

Returns the value of attribute receipt_handle.



307
308
309
# File 'lib/sqs/right_sqs_gen2.rb', line 307

def receipt_handle
  @receipt_handle
end

#receive_checksumObject

Returns the value of attribute receive_checksum.



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

def receive_checksum
  @receive_checksum
end

#received_atObject

Returns the value of attribute received_at.



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

def received_at
  @received_at
end

#send_checksumObject

Returns the value of attribute send_checksum.



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

def send_checksum
  @send_checksum
end

#sent_atObject

Returns the value of attribute sent_at.



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

def sent_at
  @sent_at
end

#visibilityObject

Returns the value of attribute visibility.



307
308
309
# File 'lib/sqs/right_sqs_gen2.rb', line 307

def visibility
  @visibility
end

Instance Method Details

#deleteObject

Removes message from queue. Returns true.



336
337
338
# File 'lib/sqs/right_sqs_gen2.rb', line 336

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

#to_sObject

Returns Message instance body.



324
325
326
# File 'lib/sqs/right_sqs_gen2.rb', line 324

def to_s
  @body
end