Sha256: 64f980b57a401f05f36e4d1a7e2d868e14e1a43fa1e04faedb8c6e026fc4e55c

Contents?: true

Size: 704 Bytes

Versions: 3

Compression:

Stored size: 704 Bytes

Contents

# frozen_string_literal: true
module BunnyMock
  module Exchanges
    class Header < BunnyMock::Exchange

      # @private
      # @return [Regexp] Any match
      ANY = /^any$/i

      # @private
      # @return [Regexp] All match
      ALL = /^all$/i

      #
      # API
      #

      ##
      # Deliver a message to routes with header matches
      #
      # @param [Object] payload Message content
      # @param [Hash] opts Message properties
      # @param [String] key Routing key
      #
      # @api public
      #
      def deliver(payload, opts, key)

        # ~: proper headers exchange implementation
        @routes[key].publish payload, opts if @routes[key]
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bunny-mock-1.2.2 lib/bunny_mock/exchanges/headers.rb
bunny-mock-1.2.1 lib/bunny_mock/exchanges/headers.rb
bunny-mock-1.2.0 lib/bunny_mock/exchanges/headers.rb