Class: Riak::Client::HTTPBackend::RequestHeaders
- Inherits:
-
Util::Headers
- Object
- Util::Headers
- Riak::Client::HTTPBackend::RequestHeaders
- Defined in:
- lib/riak/client/http_backend/request_headers.rb
Instance Method Summary collapse
-
#initialize(hash) ⇒ RequestHeaders
constructor
A new instance of RequestHeaders.
- #to_a ⇒ Object
- #to_hash ⇒ Object
Methods inherited from Util::Headers
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_a ⇒ Object
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_hash ⇒ Object
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 |