Sha256: f073665ae943318b71d01cc8892c369147c1e15c3577dc7dafcf9589670ff514

Contents?: true

Size: 686 Bytes

Versions: 29

Compression:

Stored size: 686 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
    #

    # @private
    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

29 entries across 29 versions & 1 rubygems

Version Path
bunny-1.4.1 lib/bunny/compatibility.rb
bunny-1.4.0 lib/bunny/compatibility.rb
bunny-1.3.1 lib/bunny/compatibility.rb
bunny-1.3.0 lib/bunny/compatibility.rb
bunny-1.2.2 lib/bunny/compatibility.rb
bunny-1.2.1 lib/bunny/compatibility.rb
bunny-1.2.0 lib/bunny/compatibility.rb
bunny-1.1.9 lib/bunny/compatibility.rb
bunny-1.1.8 lib/bunny/compatibility.rb
bunny-1.1.7 lib/bunny/compatibility.rb
bunny-1.1.6 lib/bunny/compatibility.rb
bunny-1.1.5 lib/bunny/compatibility.rb
bunny-1.1.4 lib/bunny/compatibility.rb
bunny-1.1.3 lib/bunny/compatibility.rb
bunny-1.1.2 lib/bunny/compatibility.rb
bunny-1.1.1 lib/bunny/compatibility.rb
bunny-1.1.0 lib/bunny/compatibility.rb
bunny-1.1.0.rc1 lib/bunny/compatibility.rb
bunny-1.0.7 lib/bunny/compatibility.rb
bunny-1.0.6 lib/bunny/compatibility.rb