Class: Jungle::SQSMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/jungle/client.rb

Overview

Contains a message that has been received from a queue.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue_path, xml) ⇒ SQSMessage

Returns a new instance of SQSMessage.



483
484
485
486
# File 'lib/jungle/client.rb', line 483

def initialize(queue_path, xml)
  @queue_path = queue_path
  m, @id, @body = *xml.match(/<MessageId>(.*?)<\/MessageId><MessageBody>(.*?)<\/MessageBody>/m)
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



481
482
483
# File 'lib/jungle/client.rb', line 481

def body
  @body
end

#idObject

Returns the value of attribute id.



481
482
483
# File 'lib/jungle/client.rb', line 481

def id
  @id
end

#queue_pathObject

Returns the value of attribute queue_path.



481
482
483
# File 'lib/jungle/client.rb', line 481

def queue_path
  @queue_path
end

Instance Method Details

#inspectObject



488
489
490
# File 'lib/jungle/client.rb', line 488

def inspect
  puts "#<Message id:#{@id} body:#{@body}>"
end