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
@private
# File lib/bunny/message_properties.rb, line 18 def initialize(properties) @properties = properties end
Public Instance Methods
Accesses message properties by key @see Hash#[]
# File lib/bunny/message_properties.rb, line 30 def [](k) @properties[k] end
@return [String] Publishing application, as set by the publisher
# File lib/bunny/message_properties.rb, line 110 def app_id @properties[:app_id] end
@return [String] Cluster ID, as set by the publisher
# File lib/bunny/message_properties.rb, line 115 def cluster_id @properties[:cluster_id] end
@return [String] (Optional) content encoding of the message, as set by the publisher
# File lib/bunny/message_properties.rb, line 55 def content_encoding @properties[:content_encoding] end
@return [String] (Optional) content type of the message, as set by the publisher
# File lib/bunny/message_properties.rb, line 50 def content_type @properties[:content_type] end
@return [String] What message this message is a reply to (or corresponds to), as set by the publisher
# File lib/bunny/message_properties.rb, line 75 def correlation_id @properties[:correlation_id] end
@return [Integer] Delivery mode (persistent or transient)
# File lib/bunny/message_properties.rb, line 65 def delivery_mode @properties[:delivery_mode] end
Iterates over the message properties @see Enumerable#each
# File lib/bunny/message_properties.rb, line 24 def each(*args, &block) @properties.each(*args, &block) end
@return [String] Message expiration, as set by the publisher
# File lib/bunny/message_properties.rb, line 85 def expiration @properties[:expiration] end
@return [String] Message headers
# File lib/bunny/message_properties.rb, line 60 def headers @properties[:headers] end
@private
# File lib/bunny/message_properties.rb, line 45 def inspect to_hash.inspect end
@return [String] Message ID, as set by the publisher
# File lib/bunny/message_properties.rb, line 90 def message_id @properties[:message_id] end
@return [Integer] Message priority, as set by the publisher
# File lib/bunny/message_properties.rb, line 70 def priority @properties[:priority] end
@return [String] (Optional) How to reply to the publisher (usually a reply queue name)
# File lib/bunny/message_properties.rb, line 80 def reply_to @properties[:reply_to] end
@return [Time] Message timestamp, as set by the publisher
# File lib/bunny/message_properties.rb, line 95 def timestamp @properties[:timestamp] end
@return [Hash] Hash representation of this delivery info
# File lib/bunny/message_properties.rb, line 35 def to_hash @properties end
@private
# File lib/bunny/message_properties.rb, line 40 def to_s to_hash.to_s end
@return [String] Message type, as set by the publisher
# File lib/bunny/message_properties.rb, line 100 def type @properties[:type] end
@return [String] Publishing user, as set by the publisher
# File lib/bunny/message_properties.rb, line 105 def user_id @properties[:user_id] end