Sha256: ca030551bc4135cd1b66caec437ea5bde61249b9a04977f583195980a3c656a4

Contents?: true

Size: 587 Bytes

Versions: 2

Compression:

Stored size: 587 Bytes

Contents

# frozen_string_literal: true

module Roseflow
  module Proxycurl
    class Client
      def initialize(config = Config.new)
        @config = config
      end

      private

      def connection
        @connection ||= Faraday.new(
          url: proxycurl_base_url,
        ) do |faraday|
          faraday.request :authorization, :Bearer, -> { config.api_key }
          faraday.request :url_encoded
          faraday.adapter Faraday.default_adapter
        end
      end

      def proxycurl_base_url
        @config.base_url || Config::DEFAULT_BASE_URL
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
roseflow-proxycurl-0.5.1 lib/roseflow/proxycurl/client.rb
roseflow-proxycurl-0.5.0 lib/roseflow/proxycurl/client.rb