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
amq-client-0.7.0.alpha31 lib/amq/protocol/get_response.rb
amq-client-0.7.0.alpha30 lib/amq/protocol/get_response.rb
amq-client-0.7.0.alpha29 lib/amq/protocol/get_response.rb
amq-client-0.7.0.alpha28 lib/amq/protocol/get_response.rb
amq-client-0.7.0.alpha27 lib/amq/protocol/get_response.rb
amq-client-0.7.0.alpha26 lib/amq/protocol/get_response.rb
amq-client-0.7.0.alpha25 lib/amq/protocol/get_response.rb
amq-client-0.7.0.alpha24 lib/amq/protocol/get_response.rb
amq-client-0.7.0.alpha23 lib/amq/client/protocol/get_response.rb
amq-client-0.7.0.alpha22 lib/amq/client/protocol/get_response.rb
amq-client-0.7.0.alpha21 lib/amq/client/protocol/get_response.rb
amq-client-0.7.0.alpha20 lib/amq/client/protocol/get_response.rb
amq-client-0.7.0.alpha19 lib/amq/client/protocol/get_response.rb
amq-client-0.7.0.alpha18 lib/amq/client/protocol/get_response.rb
amq-client-0.7.0.alpha17 lib/amq/client/protocol/get_response.rb
amq-client-0.7.0.alpha16 lib/amq/client/protocol/get_response.rb
amq-client-0.7.0.alpha15 lib/amq/client/protocol/get_response.rb
amq-client-0.7.0.alpha14 lib/amq/client/protocol/get_response.rb
amq-client-0.7.0.alpha13 lib/amq/client/protocol/get_response.rb
amq-client-0.7.0.alpha12 lib/amq/client/protocol/get_response.rb