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, rh = nil, body = nil, visibility = nil) ⇒ Message

Returns a new instance of Message.



259
260
261
262
263
264
265
266
267
268
269
# File 'lib/sqs/right_sqs.rb', line 259

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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



256
257
258
# File 'lib/sqs/right_sqs.rb', line 256

def body
  @body
end

#idObject (readonly)

Returns the value of attribute id.



256
257
258
# File 'lib/sqs/right_sqs.rb', line 256

def id
  @id
end

#queueObject (readonly)

Returns the value of attribute queue.



256
257
258
# File 'lib/sqs/right_sqs.rb', line 256

def queue
  @queue
end

#receipt_handleObject (readonly)

Returns the value of attribute receipt_handle.



256
257
258
# File 'lib/sqs/right_sqs.rb', line 256

def receipt_handle
  @receipt_handle
end

#receive_checksumObject

Returns the value of attribute receive_checksum.



257
258
259
# File 'lib/sqs/right_sqs.rb', line 257

def receive_checksum
  @receive_checksum
end

#received_atObject

Returns the value of attribute received_at.



257
258
259
# File 'lib/sqs/right_sqs.rb', line 257

def received_at
  @received_at
end

#send_checksumObject

Returns the value of attribute send_checksum.



257
258
259
# File 'lib/sqs/right_sqs.rb', line 257

def send_checksum
  @send_checksum
end

#sent_atObject

Returns the value of attribute sent_at.



257
258
259
# File 'lib/sqs/right_sqs.rb', line 257

def sent_at
  @sent_at
end

#visibilityObject (readonly)

Returns the value of attribute visibility.



256
257
258
# File 'lib/sqs/right_sqs.rb', line 256

def visibility
  @visibility
end

Instance Method Details

#deleteObject

Removes message from queue. Returns true.



278
279
280
# File 'lib/sqs/right_sqs.rb', line 278

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

#to_sObject

Returns Message instance body.



272
273
274
# File 'lib/sqs/right_sqs.rb', line 272

def to_s
  @body
end