class FDK::InHeaders
Represents inbound HTTP headers
Public Class Methods
new(headers, key_fn)
click to toggle source
# File lib/fdk/context.rb, line 31 def initialize(headers, key_fn) @headers = headers @key_fn = key_fn end
Public Instance Methods
[](key)
click to toggle source
# File lib/fdk/context.rb, line 41 def [](key) h = @headers[header_key(key)] return h[0] unless h.nil? end
each(&block)
click to toggle source
# File lib/fdk/context.rb, line 46 def each(&block) @headers.each(&block) end
header_key(key)
click to toggle source
# File lib/fdk/context.rb, line 36 def header_key(key) key = @key_fn.call(key) if @key_fn key.downcase end