Class: FakeSQS::Message
- Inherits:
-
Object
- Object
- FakeSQS::Message
- Defined in:
- lib/fake_sqs/message.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(options = {}) ⇒ Message
constructor
A new instance of Message.
- #md5 ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Message
Returns a new instance of Message.
8 9 10 |
# File 'lib/fake_sqs/message.rb', line 8 def initialize( = {}) @body = .fetch("MessageBody") end |
Instance Attribute Details
#body ⇒ Object (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
#id ⇒ Object
12 13 14 |
# File 'lib/fake_sqs/message.rb', line 12 def id @id ||= SecureRandom.uuid end |
#md5 ⇒ Object
16 17 18 |
# File 'lib/fake_sqs/message.rb', line 16 def md5 @md5 ||= Digest::MD5.hexdigest(body) end |