Class: FakeSQS::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/fake_sqs/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Message

Returns a new instance of Message.



8
9
10
# File 'lib/fake_sqs/message.rb', line 8

def initialize(options = {})
  @body = options.fetch("MessageBody")
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



6
7
8
# File 'lib/fake_sqs/message.rb', line 6

def body
  @body
end

Instance Method Details

#idObject



12
13
14
# File 'lib/fake_sqs/message.rb', line 12

def id
  @id ||= SecureRandom.uuid
end

#md5Object



16
17
18
# File 'lib/fake_sqs/message.rb', line 16

def md5
  @md5 ||= Digest::MD5.hexdigest(body)
end