Class: FDK::OutHeaders
Overview
Represents outbound HTTP headers
Instance Method Summary collapse
- #[]=(key, value) ⇒ Object
- #delete(key) ⇒ Object
-
#initialize(headers, key_in_fn) ⇒ OutHeaders
constructor
A new instance of OutHeaders.
Methods inherited from InHeaders
Constructor Details
#initialize(headers, key_in_fn) ⇒ OutHeaders
Returns a new instance of OutHeaders.
53 54 55 56 57 |
# File 'lib/fdk/context.rb', line 53 def initialize(headers, key_in_fn) headers["Fn-Fdk-Version"] = ["fdk-ruby/#{FDK::VERSION}"] headers["Fn-Fdk-Runtime"] = ["ruby/#{RUBY_VERSION}"] super(headers, key_in_fn) end |
Instance Method Details
#[]=(key, value) ⇒ Object
59 60 61 62 63 64 65 66 67 |
# File 'lib/fdk/context.rb', line 59 def []=(key, value) if value.is_a? Array h = [] value.each { |x| h.push(x.to_s) } @headers[header_key(key)] = h else @headers[header_key(key)] = [value.to_s] end end |
#delete(key) ⇒ Object
69 70 71 |
# File 'lib/fdk/context.rb', line 69 def delete(key) @headers.delete header_key(key) end |