Module: Algolia::Transport

Defined in:
lib/algolia/transport/transport.rb,
lib/algolia/transport/stateful_host.rb,
lib/algolia/transport/echo_requester.rb,
lib/algolia/transport/retry_strategy.rb,
lib/algolia/transport/request_options.rb

Defined Under Namespace

Classes: EchoRequester, RequestOptions, RetryStrategy, StatefulHost, Transport

Class Method Summary collapse

Class Method Details

.encode_uri(uri) ⇒ Object



9
10
11
# File 'lib/algolia/transport/transport.rb', line 9

def self.encode_uri(uri)
  CGI.escape(uri).gsub("+", "%20")
end

.stringify_query_params(query_params) ⇒ Object



13
14
15
16
17
18
# File 'lib/algolia/transport/transport.rb', line 13

def self.stringify_query_params(query_params)
  query_params.to_h do |key, value|
    value = value.join(",") if value.is_a?(Array)
    [encode_uri(key.to_s).to_sym, encode_uri(value.to_s)]
  end
end