Sha256: 53dce9f4fea339ce07ba914ebd87fbea7f11ced2b7890b638272686630175a48
Contents?: true
Size: 529 Bytes
Versions: 8
Compression:
Stored size: 529 Bytes
Contents
# frozen_string_literal: true module Kiev module Kafka class MessageContext # @param [Kafka::FetchedMessage] message def initialize(message) @headers = message.headers end def value(field) headers[header_key(field)] || headers[field.to_s] end alias_method :[], :value private attr_reader :headers # @param [String] field def header_key(field) "x_#{field}".gsub("_", " ").split.map(&:capitalize).join("-") end end end end
Version data entries
8 entries across 8 versions & 1 rubygems