/usr/lib/ruby/vendor_ruby/amqp/broker.rb is in ruby-amqp 0.9.5-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | # encoding: utf-8
module AMQP
# A utility class that makes inspection of broker capabilities easier.
class Broker
#
# API
#
RABBITMQ_PRODUCT = "RabbitMQ".freeze
# Broker information
# @return [Hash]
# @see Session#server_properties
attr_reader :properties
# @return [Hash] properties Broker information
# @see Session#server_properties
def initialize(properties)
@properties = properties
end # initialize(properties)
# @group Product information
# @return [Boolean] true if broker is RabbitMQ
def rabbitmq?
self.product == RABBITMQ_PRODUCT
end # rabbitmq?
# @return [String] Broker product information
def product
@product ||= @properties["product"]
end # product
# @return [String] Broker version
def version
@version ||= @properties["version"]
end # version
# @endgroup
# @group Product capabilities
# @return [Boolean]
def supports_publisher_confirmations?
@properties["capabilities"]["publisher_confirms"]
end # supports_publisher_confirmations?
# @return [Boolean]
def supports_basic_nack?
@properties["capabilities"]["basic.nack"]
end # supports_basic_nack?
# @return [Boolean]
def supports_consumer_cancel_notifications?
@properties["capabilities"]["consumer_cancel_notify"]
end # supports_consumer_cancel_notifications?
# @return [Boolean]
def supports_exchange_to_exchange_bindings?
@properties["capabilities"]["exchange_exchange_bindings"]
end # supports_exchange_to_exchange_bindings?
# @endgroup
end # Broker
end # AMQP
|