Class: BunnyMock::MessageProperties
- Inherits:
-
Object
- Object
- BunnyMock::MessageProperties
- Includes:
- Enumerable
- Defined in:
- lib/bunny_mock/message_properties.rb
Instance Method Summary collapse
-
#[](key) ⇒ Object
Access properties by key.
-
#app_id ⇒ String
Publishing application, as set by the publisher.
-
#cluster_id ⇒ String
Cluster ID, as set by the publisher.
-
#content_encoding ⇒ String
(Optional) content encoding of the message, as set by the publisher.
-
#content_type ⇒ String
(Optional) content type of the message, as set by the publisher.
-
#correlation_id ⇒ String
What message this message is a reply to (or corresponds to), as set by the publisher.
-
#delivery_mode ⇒ Integer
Delivery mode (persistent or transient).
-
#each(*args, &block) ⇒ Object
Iterate over the properties.
-
#expiration ⇒ String
Message expiration, as set by the publisher.
-
#headers ⇒ String
Message headers.
-
#message_id ⇒ String
Message ID, as set by the publisher.
-
#priority ⇒ Integer
Message priority, as set by the publisher.
-
#reply_to ⇒ String
(Optional) How to reply to the publisher (usually a reply queue name).
-
#timestamp ⇒ Time
Message timestamp, as set by the publisher.
-
#to_hash ⇒ Hash
Hash of message properties.
-
#to_s ⇒ String
(also: #inspect)
String representation of message properties.
-
#type ⇒ String
Message type, as set by the publisher.
-
#user_id ⇒ String
Publishing user, as set by the publisher.
Instance Method Details
#[](key) ⇒ Object
Access properties by key
28 29 30 |
# File 'lib/bunny_mock/message_properties.rb', line 28 def [](key) @properties[key] end |
#app_id ⇒ String
Returns Publishing application, as set by the publisher.
104 105 106 |
# File 'lib/bunny_mock/message_properties.rb', line 104 def app_id @properties[:app_id] end |
#cluster_id ⇒ String
Returns Cluster ID, as set by the publisher.
109 110 111 |
# File 'lib/bunny_mock/message_properties.rb', line 109 def cluster_id @properties[:cluster_id] end |
#content_encoding ⇒ String
Returns (Optional) content encoding of the message, as set by the publisher.
49 50 51 |
# File 'lib/bunny_mock/message_properties.rb', line 49 def content_encoding @properties[:content_encoding] end |
#content_type ⇒ String
Returns (Optional) content type of the message, as set by the publisher.
44 45 46 |
# File 'lib/bunny_mock/message_properties.rb', line 44 def content_type @properties[:content_type] end |
#correlation_id ⇒ String
Returns What message this message is a reply to (or corresponds to), as set by the publisher.
69 70 71 |
# File 'lib/bunny_mock/message_properties.rb', line 69 def correlation_id @properties[:correlation_id] end |
#delivery_mode ⇒ Integer
Returns Delivery mode (persistent or transient).
59 60 61 |
# File 'lib/bunny_mock/message_properties.rb', line 59 def delivery_mode @properties[:delivery_mode] end |
#each(*args, &block) ⇒ Object
Iterate over the properties
22 23 24 |
# File 'lib/bunny_mock/message_properties.rb', line 22 def each(*args, &block) @properties.each(*args, &block) end |
#expiration ⇒ String
Returns Message expiration, as set by the publisher.
79 80 81 |
# File 'lib/bunny_mock/message_properties.rb', line 79 def expiration @properties[:expiration] end |
#headers ⇒ String
Returns Message headers.
54 55 56 |
# File 'lib/bunny_mock/message_properties.rb', line 54 def headers @properties[:headers] end |
#message_id ⇒ String
Returns Message ID, as set by the publisher.
84 85 86 |
# File 'lib/bunny_mock/message_properties.rb', line 84 def @properties[:message_id] end |
#priority ⇒ Integer
Returns Message priority, as set by the publisher.
64 65 66 |
# File 'lib/bunny_mock/message_properties.rb', line 64 def priority @properties[:priority] end |
#reply_to ⇒ String
Returns (Optional) How to reply to the publisher (usually a reply queue name).
74 75 76 |
# File 'lib/bunny_mock/message_properties.rb', line 74 def reply_to @properties[:reply_to] end |
#timestamp ⇒ Time
Returns Message timestamp, as set by the publisher.
89 90 91 |
# File 'lib/bunny_mock/message_properties.rb', line 89 def @properties[:timestamp] end |
#to_hash ⇒ Hash
Returns Hash of message properties.
33 34 35 |
# File 'lib/bunny_mock/message_properties.rb', line 33 def to_hash @properties end |
#to_s ⇒ String Also known as: inspect
Returns String representation of message properties.
38 39 40 |
# File 'lib/bunny_mock/message_properties.rb', line 38 def to_s to_hash.to_s end |
#type ⇒ String
Returns Message type, as set by the publisher.
94 95 96 |
# File 'lib/bunny_mock/message_properties.rb', line 94 def type @properties[:type] end |
#user_id ⇒ String
Returns Publishing user, as set by the publisher.
99 100 101 |
# File 'lib/bunny_mock/message_properties.rb', line 99 def user_id @properties[:user_id] end |