Method: HTTPX::Resolver.resolver_for

Defined in:
lib/httpx/resolver.rb

.resolver_for(resolver_type) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/httpx/resolver.rb', line 25

def resolver_for(resolver_type)
  case resolver_type
  when :native then Native
  when :system then System
  when :https then HTTPS
  else
    return resolver_type if resolver_type.is_a?(Class) && resolver_type < Resolver

    raise Error, "unsupported resolver type (#{resolver_type})"
  end
end