Class: Rdkafka::Consumer::Headers::HashWithSymbolKeysTreatedLikeStrings

Inherits:
Hash
  • Object
show all
Defined in:
lib/rdkafka/consumer/headers.rb

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/rdkafka/consumer/headers.rb', line 8

def [](key)
  if key.is_a?(Symbol)
    Kernel.warn("rdkafka deprecation warning: header access with Symbol key #{key.inspect} treated as a String. " \
                "Please change your code to use String keys to avoid this warning. Symbol keys will break in version 1.")
    super(key.to_s)
  else
    super
  end
end