Sha256: 6a54b0ec026a4193e0612b98b7d220767f031b1d81545f5f629a07236b28a9ac

Contents?: true

Size: 499 Bytes

Versions: 9

Compression:

Stored size: 499 Bytes

Contents

# frozen_string_literal: true

require "kiev/context_reader"

module Kiev
  module Shoryuken
    class ContextReader < Kiev::ContextReader
      def initialize(message)
        super
        @message_attributes = message.message_attributes
      end

      def [](key)
        return unless @message_attributes.key?(key)

        attribute_value = @message_attributes[key]
        return unless attribute_value.data_type == "String"

        attribute_value.string_value
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
kiev-4.9.0 lib/kiev/shoryuken/context_reader.rb
kiev-4.8.3 lib/kiev/shoryuken/context_reader.rb
kiev-4.8.2 lib/kiev/shoryuken/context_reader.rb
kiev-4.8.1 lib/kiev/shoryuken/context_reader.rb
kiev-4.8.0 lib/kiev/shoryuken/context_reader.rb
kiev-4.7.0 lib/kiev/shoryuken/context_reader.rb
kiev-4.6.0 lib/kiev/shoryuken/context_reader.rb
kiev-4.5.0 lib/kiev/shoryuken/context_reader.rb
kiev-4.4.0 lib/kiev/shoryuken/context_reader.rb