Class: Rufus::SQS::Message

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

Overview

An SQS message (after its creation).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue, xml_element) ⇒ Message

Returns a new instance of Message.



52
53
54
55
56
57
# File 'lib/rufus/sqs.rb', line 52

def initialize (queue, xml_element)

    @queue = queue
    @message_id = SQS::get_element_text(xml_element, "MessageId")
    @message_body = SQS::get_element_text(xml_element, "MessageBody")
end

Instance Attribute Details

#message_bodyObject (readonly)

Returns the value of attribute message_body.



50
51
52
# File 'lib/rufus/sqs.rb', line 50

def message_body
  @message_body
end

#message_idObject (readonly)

Returns the value of attribute message_id.



50
51
52
# File 'lib/rufus/sqs.rb', line 50

def message_id
  @message_id
end

#queueObject (readonly)

Returns the value of attribute queue.



50
51
52
# File 'lib/rufus/sqs.rb', line 50

def queue
  @queue
end

Instance Method Details

#deleteObject

Connects to the queue service and deletes this message in its queue.



62
63
64
65
# File 'lib/rufus/sqs.rb', line 62

def delete

    @queue.queue_service.delete_message(@queue, @message_id)
end