Class: Kiev::Shoryuken::ContextReader

Inherits:
ContextReader show all
Defined in:
lib/kiev/shoryuken/context_reader.rb

Constant Summary

Constants inherited from ContextReader

ContextReader::REQUEST_DEPTH, ContextReader::REQUEST_ID, ContextReader::TRACKING_ID, ContextReader::TREE_PATH

Instance Method Summary collapse

Methods inherited from ContextReader

#request_depth, #tracking_id, #tree_path, #tree_root?

Constructor Details

#initialize(message) ⇒ ContextReader

Returns a new instance of ContextReader.



8
9
10
11
# File 'lib/kiev/shoryuken/context_reader.rb', line 8

def initialize(message)
  super
  @message_attributes = message.message_attributes
end

Instance Method Details

#[](key) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/kiev/shoryuken/context_reader.rb', line 13

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