Class: HTTParty::HeadersProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/httparty/headers_processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(headers, options) ⇒ HeadersProcessor

Returns a new instance of HeadersProcessor.


5
6
7
8
# File 'lib/httparty/headers_processor.rb', line 5

def initialize(headers, options)
  @headers = headers
  @options = options
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers


3
4
5
# File 'lib/httparty/headers_processor.rb', line 3

def headers
  @headers
end

#optionsObject (readonly)

Returns the value of attribute options


3
4
5
# File 'lib/httparty/headers_processor.rb', line 3

def options
  @options
end

Instance Method Details

#callObject


10
11
12
13
14
15
# File 'lib/httparty/headers_processor.rb', line 10

def call
  return unless options[:headers]

  options[:headers] = headers.merge(options[:headers]) if headers.any?
  options[:headers] = Utils.stringify_keys(process_dynamic_headers)
end