Sha256: 1f0bf7d3701710de5f13b63db352cfe1c6e802411024d9677312f42071f31c9a

Contents?: true

Size: 1.08 KB

Versions: 92

Compression:

Stored size: 1.08 KB

Contents

# encoding: utf-8

# Purpose of this class is to simplify work with GetOk and GetEmpty.
module AMQ
  module Protocol
    class GetResponse
      attr_reader :method
      def initialize(method)
        @method = method
      end

      def empty?
        @method.is_a?(::AMQ::Protocol::Basic::GetEmpty)
      end

      # GetOk attributes
      def delivery_tag
        if @method.respond_to?(:delivery_tag)
          @method.delivery_tag
        end
      end

      def redelivered
        if @method.respond_to?(:redelivered)
          @method.redelivered
        end
      end

      def exchange
        if @method.respond_to?(:exchange)
          @method.exchange
        end
      end

      def routing_key
        if @method.respond_to?(:routing_key)
          @method.routing_key
        end
      end

      def message_count
        if @method.respond_to?(:message_count)
          @method.message_count
        end
      end

      # GetEmpty attributes
      def cluster_id
        if @method.respond_to?(:cluster_id)
          @method.cluster_id
        end
      end
    end
  end
end

Version data entries

92 entries across 92 versions & 2 rubygems

Version Path
amqp-1.8.0 lib/amq/protocol/get_response.rb
amqp-1.7.0 lib/amq/protocol/get_response.rb
amqp-1.6.0 lib/amq/protocol/get_response.rb
amqp-1.5.3 lib/amq/protocol/get_response.rb
amqp-1.5.2 lib/amq/protocol/get_response.rb
amqp-1.5.1 lib/amq/protocol/get_response.rb
amqp-1.5.0 lib/amq/protocol/get_response.rb
amqp-1.4.2 lib/amq/protocol/get_response.rb
amqp-1.4.1 lib/amq/protocol/get_response.rb
amqp-1.4.0 lib/amq/protocol/get_response.rb
amqp-1.3.0 lib/amq/protocol/get_response.rb
amqp-1.2.1 lib/amq/protocol/get_response.rb
amqp-1.2.0 lib/amq/protocol/get_response.rb
amqp-1.1.8 lib/amq/protocol/get_response.rb
amqp-1.1.7 lib/amq/protocol/get_response.rb
amqp-1.1.6 lib/amq/protocol/get_response.rb
amqp-1.1.5 lib/amq/protocol/get_response.rb
amqp-1.1.4 lib/amq/protocol/get_response.rb
amqp-1.1.3 lib/amq/protocol/get_response.rb
amq-client-1.0.4 lib/amq/protocol/get_response.rb