Class: Riak::Client::HTTPBackend::RequestHeaders

Inherits:
Util::Headers show all
Defined in:
lib/riak/client/http_backend/request_headers.rb

Instance Method Summary collapse

Methods inherited from Util::Headers

parse, #parse

Constructor Details

#initialize(hash) ⇒ RequestHeaders

Returns a new instance of RequestHeaders.



11
12
13
# File 'lib/riak/client/http_backend/request_headers.rb', line 11

def initialize(hash)
  initialize_http_header(hash)
end

Instance Method Details

#to_aObject



15
16
17
18
19
20
21
# File 'lib/riak/client/http_backend/request_headers.rb', line 15

def to_a
  [].tap do |arr|
    each_capitalized do |k,v|
      arr << "#{k}: #{v}"
    end
  end
end

#to_hashObject



23
24
25
26
27
28
29
30
# File 'lib/riak/client/http_backend/request_headers.rb', line 23

def to_hash
  {}.tap do |hash|
    each_capitalized do |k,v|
      hash[k] ||= []
      hash[k] << v
    end
  end
end