Sha256: 912eefefad8bbef63c6e83a5cf50835b8d83ba456ef04bf6d096ffb20d831604

Contents?: true

Size: 632 Bytes

Versions: 29

Compression:

Stored size: 632 Bytes

Contents

require 'riak/util/headers'

module Riak
  class Client
    class HTTPBackend
      # @private
      class RequestHeaders < Riak::Util::Headers
        alias each each_capitalized

        def initialize(hash)
          initialize_http_header(hash)
        end

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

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

Version data entries

29 entries across 19 versions & 3 rubygems

Version Path
riak-client-1.0.3 lib/riak/client/http_backend/request_headers.rb
riak-client-1.0.3 pkg/riak-client-1.0.2/pkg/riak-client-1.0.1/pkg/riak-client-1.0.0/lib/riak/client/http_backend/request_headers.rb
riak-client-1.0.2 lib/riak/client/http_backend/request_headers.rb
riak-client-1.0.2 pkg/riak-client-1.0.1/lib/riak/client/http_backend/request_headers.rb
riak-client-1.0.2 pkg/riak-client-1.0.0/lib/riak/client/http_backend/request_headers.rb
riak-client-1.0.2 pkg/riak-client-1.0.1/pkg/riak-client-1.0.0/lib/riak/client/http_backend/request_headers.rb
riak-client-1.0.0 lib/riak/client/http_backend/request_headers.rb
seomoz-riak-client-1.0.0.pre lib/riak/client/http_backend/request_headers.rb
riak-client-1.0.0.beta lib/riak/client/http_backend/request_headers.rb