class Magellan::Gcs::Proxy::MessageWrapper

Attributes

context[R]
msg[R]

Public Class Methods

new(context) click to toggle source
# File lib/magellan/gcs/proxy/message_wrapper.rb, line 8
def initialize(context)
  @msg = context.message
  @context = ContextAccessor.new(context)
end

Public Instance Methods

[](key) click to toggle source
# File lib/magellan/gcs/proxy/message_wrapper.rb, line 13
def [](key)
  case key.to_sym
  when :attrs, :attributes then return attributes
  when :data then return msg.data
  end
  context[key.to_sym]
end
attributes() click to toggle source
# File lib/magellan/gcs/proxy/message_wrapper.rb, line 26
def attributes
  Attrs.new(msg.attributes)
end
include?(key) click to toggle source
# File lib/magellan/gcs/proxy/message_wrapper.rb, line 21
def include?(key)
  k = key.to_sym
  context.include?(k) || [:attrs, :attributes, :data].include?(k)
end