module RequestTracer::Integration::Base
Constants
- HEADER_REGEX
Public Instance Methods
extract_fields_from_headers(header_hash)
click to toggle source
# File lib/request_tracer/integration/base.rb, line 5 def extract_fields_from_headers(header_hash) header_hash.map do |k,v| special_header = HEADER_REGEX.match(k) special_header && [B3_REQUIRED_FIELDS_FROM_SHORT_NAMES[special_header[1].downcase], v] end.compact.to_h end
extract_headers_from_fields(field_hash)
click to toggle source
# File lib/request_tracer/integration/base.rb, line 11 def extract_headers_from_fields(field_hash) B3_REQUIRED_FIELDS.map {|f| ["X-B3-" + f.split('_').collect(&:capitalize).join, field_hash[f]]}.to_h end