class Hoodoo::Monkey::Patch::NewRelicTracedAMQP::AlchemyFluxHTTPResponseWrapper

Wrapper class for an AMQP request which conforms to the API that NewRelic expects.

Public Class Methods

new( response_hash ) click to toggle source

The response_hash to be wrapped.

response_hash

Hash describing the response returned from Alchemy Flux. See that gem for details.

# File lib/hoodoo/monkey/patch/newrelic_traced_amqp.rb, line 184
def initialize( response_hash )
  @response_hash = response_hash
end

Public Instance Methods

[]( key ) click to toggle source

Look up a key in the headers Hash first, but if absent try the top-level response Hash instead.

key

Hash key to look up.

# File lib/hoodoo/monkey/patch/newrelic_traced_amqp.rb, line 193
def []( key )
  @response_hash[ 'headers' ][ key ] || @response_hash[ key ]
end
to_hash() click to toggle source

Return the HTTP headers for this response as a Hash.

# File lib/hoodoo/monkey/patch/newrelic_traced_amqp.rb, line 199
def to_hash
  @response_hash[ 'headers' ].dup()
end