Class: Moqueue::MockExchange::DirectBindingKey

Inherits:
Object
  • Object
show all
Includes:
BaseKey
Defined in:
lib/moqueue/mock_exchange.rb

Overview

Requires an exact match

Instance Attribute Summary

Attributes included from BaseKey

#key

Instance Method Summary collapse

Methods included from BaseKey

#==

Constructor Details

#initialize(key_string) ⇒ DirectBindingKey

Returns a new instance of DirectBindingKey.



132
133
134
# File 'lib/moqueue/mock_exchange.rb', line 132

def initialize(key_string)
  @key = key_string.to_s
end

Instance Method Details

#matches?(message_key) ⇒ Boolean

Returns:

  • (Boolean)


136
137
138
139
140
141
# File 'lib/moqueue/mock_exchange.rb', line 136

def matches?(message_key)
  message_key, binding_key = message_key.to_s, key.dup

  # looking for string equivalence
  message_key == binding_key
end