Sha256: 62d95a15b2079ddfb7616894f1dc12b87551d8360eda754e93abda57dc1f4b1e
Contents?: true
Size: 613 Bytes
Versions: 5
Compression:
Stored size: 613 Bytes
Contents
# frozen_string_literal: true require 'forwardable' gem 'typhoeus' require 'typhoeus' class RestClient class TyphoeusAdapter def call(url, query, headers = {}, proxy = {}) raise NotImplementedError, 'Proxying Not Yet Implemented' if proxy[:host] TyphoeusAdapter::Response.new( Typhoeus.get( url, params: query, headers: headers ) ) end Response = Struct.new(:raw) do extend Forwardable def_delegators :raw, :body, :to_s, :code, :headers def status raw.code end end end end
Version data entries
5 entries across 5 versions & 1 rubygems