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.



7
8
9
10
# File 'lib/httparty/headers_processor.rb', line 7

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

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



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

def headers
  @headers
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#callObject



12
13
14
15
16
17
# File 'lib/httparty/headers_processor.rb', line 12

def call
  return unless options[:headers]

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