Class: Aranha::Parsers::SourceAddress::HashHttpBase::Headers

Inherits:
Object
  • Object
show all
Defined in:
lib/aranha/parsers/source_address/hash_http_base/headers.rb

Instance Method Summary collapse

Instance Method Details

#merge(other_values) ⇒ Aranha::Parsers::SourceAddress::HashHttpBase::Headers

Parameters:

  • other_values (Array, Hash)

Returns:



19
20
21
22
23
24
25
26
27
28
# File 'lib/aranha/parsers/source_address/hash_http_base/headers.rb', line 19

def merge(other_values)
  if other_values.is_a?(::Hash)
    values(values.merge(other_values))
  elsif other_values.is_a?(::Enumerable)
    merge(other_values.to_h { |v| merge_array_item_to_h(v) })
  else
    raise ::ArgumentError,
          "\"other_values\"=\"#{other_values}\" should be a Array or a Hash"
  end
end

#to_hHash

Returns:

  • (Hash)


15
# File 'lib/aranha/parsers/source_address/hash_http_base/headers.rb', line 15

delegate :to_h, to: :values