Class: AzureClient::Message
- Inherits:
-
Object
- Object
- AzureClient::Message
- Defined in:
- lib/azure_client/message.rb
Instance Method Summary collapse
- #delete(retry_policy = @retry_policy) ⇒ Object
- #get_content ⇒ Object
- #id ⇒ Object
-
#initialize(azure_message, queue_name, queue_service, retry_policy) ⇒ Message
constructor
A new instance of Message.
Constructor Details
#initialize(azure_message, queue_name, queue_service, retry_policy) ⇒ Message
Returns a new instance of Message.
4 5 6 7 8 9 |
# File 'lib/azure_client/message.rb', line 4 def initialize(, queue_name, queue_service, retry_policy) @azure_message = @queue_name = queue_name @queue_service = queue_service @retry_policy = retry_policy end |
Instance Method Details
#delete(retry_policy = @retry_policy) ⇒ Object
24 25 26 27 28 |
# File 'lib/azure_client/message.rb', line 24 def delete(retry_policy = @retry_policy) retry_policy.retry { @queue_service.(@queue_name, id, pop_receipt) } end |
#get_content ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/azure_client/message.rb', line 11 def get_content content = @azure_message. begin Base64.decode64(content) rescue raise $!, "Failed to decode content of azure queue message, check to make sure message is encoded, exception: #{$!}" end end |
#id ⇒ Object
20 21 22 |
# File 'lib/azure_client/message.rb', line 20 def id @azure_message.id end |