Sha256: 91bdb6e15a19748fdad9869418a09d8835eb65cbea517ace4562f33d8a638c8c

Contents?: true

Size: 600 Bytes

Versions: 2

Compression:

Stored size: 600 Bytes

Contents

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

2 entries across 2 versions & 1 rubygems

Version Path
bunny-mock-1.1.0 lib/bunny_mock/exchanges/headers.rb
bunny-mock-1.0.0 lib/bunny_mock/exchanges/headers.rb