Sha256: 2e492cab37c27cb9ed03db35b32e4b840f2d1fdefc7c3f1f4972a9b65f7ef55e

Contents?: true

Size: 689 Bytes

Versions: 24

Compression:

Stored size: 689 Bytes

Contents

module Bunny
  # Helper methods necessary to stay mostly backwards-compatible with legacy (0.7.x, 0.8.x) Bunny
  # releases that hide channels completely from the API.
  #
  # @private
  module Compatibility

    #
    # API
    #

    # @api public
    def channel_from(channel_or_connection)
      # Bunny 0.8.x and earlier completely hide channels from the API. So, queues and exchanges are
      # instantiated with a "Bunny object", which is a session. This function coerces two types of input to a
      # channel.
      if channel_or_connection.is_a?(Bunny::Session)
        channel_or_connection.default_channel
      else
        channel_or_connection
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
bunny-0.9.8 lib/bunny/compatibility.rb
bunny-0.9.7 lib/bunny/compatibility.rb
bunny-0.9.6 lib/bunny/compatibility.rb
bunny-0.9.5 lib/bunny/compatibility.rb
bunny-0.9.4 lib/bunny/compatibility.rb
bunny-0.9.3 lib/bunny/compatibility.rb
bunny-0.9.2 lib/bunny/compatibility.rb
bunny-0.9.1 lib/bunny/compatibility.rb
bunny-0.9.0 lib/bunny/compatibility.rb
bunny-0.9.0.rc2 lib/bunny/compatibility.rb
bunny-0.9.0.rc1 lib/bunny/compatibility.rb
bunny-0.9.0.pre13 lib/bunny/compatibility.rb
bunny-0.9.0.pre12 lib/bunny/compatibility.rb
bunny-0.9.0.pre11 lib/bunny/compatibility.rb
bunny-0.9.0.pre10 lib/bunny/compatibility.rb
bunny-0.9.0.pre9 lib/bunny/compatibility.rb
bunny-0.9.0.pre8 lib/bunny/compatibility.rb
bunny-0.9.0.pre7 lib/bunny/compatibility.rb
bunny-0.9.0.pre6 lib/bunny/compatibility.rb
bunny-0.9.0.pre5 lib/bunny/compatibility.rb