class Bunny::MessageProperties
Wraps basic properties hash as returned by amq-protocol to provide access to the delivery properties as immutable hash as well as methods.
Public Class Methods
Source
# File lib/bunny/message_properties.rb, line 20 def initialize(properties) @properties = properties end
@private
Public Instance Methods
Source
# File lib/bunny/message_properties.rb, line 32 def [](k) @properties[k] end
Accesses message properties by key @see Hash#[]
Source
# File lib/bunny/message_properties.rb, line 112 def app_id @properties[:app_id] end
@return [String] Publishing application, as set by the publisher
Source
# File lib/bunny/message_properties.rb, line 117 def cluster_id @properties[:cluster_id] end
@return [String] Cluster ID, as set by the publisher
Source
# File lib/bunny/message_properties.rb, line 57 def content_encoding @properties[:content_encoding] end
@return [String] (Optional) content encoding of the message, as set by the publisher
Source
# File lib/bunny/message_properties.rb, line 52 def content_type @properties[:content_type] end
@return [String] (Optional) content type of the message, as set by the publisher
Source
# File lib/bunny/message_properties.rb, line 77 def correlation_id @properties[:correlation_id] end
@return [String] What message this message is a reply to (or corresponds to), as set by the publisher
Source
# File lib/bunny/message_properties.rb, line 67 def delivery_mode @properties[:delivery_mode] end
@return [Integer] Delivery mode (persistent or transient)
Source
# File lib/bunny/message_properties.rb, line 26 def each(*args, &block) @properties.each(*args, &block) end
Iterates over the message properties @see Enumerable#each
Source
# File lib/bunny/message_properties.rb, line 87 def expiration @properties[:expiration] end
@return [String] Message expiration, as set by the publisher
Source
# File lib/bunny/message_properties.rb, line 62 def headers @properties[:headers] end
@return [String] Message headers
Source
# File lib/bunny/message_properties.rb, line 47 def inspect to_hash.inspect end
@private
Source
# File lib/bunny/message_properties.rb, line 92 def message_id @properties[:message_id] end
@return [String] Message ID, as set by the publisher
Source
# File lib/bunny/message_properties.rb, line 72 def priority @properties[:priority] end
@return [Integer] Message priority, as set by the publisher
Source
# File lib/bunny/message_properties.rb, line 82 def reply_to @properties[:reply_to] end
@return [String] (Optional) How to reply to the publisher (usually a reply queue name)
Source
# File lib/bunny/message_properties.rb, line 97 def timestamp @properties[:timestamp] end
@return [Time] Message timestamp, as set by the publisher
Source
# File lib/bunny/message_properties.rb, line 37 def to_hash @properties end
@return [Hash] Hash representation of this delivery info
Source
# File lib/bunny/message_properties.rb, line 102 def type @properties[:type] end
@return [String] Message type, as set by the publisher
Source
# File lib/bunny/message_properties.rb, line 107 def user_id @properties[:user_id] end
@return [String] Publishing user, as set by the publisher