Sha256: 1805e626ab63b279b4817ff31ba29c8d95ff920ca78f38ef5821f953338aec99

Contents?: true

Size: 598 Bytes

Versions: 7

Compression:

Stored size: 598 Bytes

Contents

module Lifen
  class Client

    private

      def faraday_client
        @faraday_client ||= Faraday.new(faraday_options) do |faraday|
          faraday.request  :url_encoded             # form-encode POST params
          faraday.adapter  Faraday.default_adapter  # make requests with Net::HTTP
        end
      end

      def faraday_options
        options = {url: site}

        options[:proxy] = proxy_url if !proxy_url.nil?

        options
      end

      def site
        Lifen.configuration.site
      end

      def proxy_url
        Lifen.configuration.proxy_url
      end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lifen-0.2.1 lib/lifen/client.rb
lifen-0.2.0 lib/lifen/client.rb
lifen-0.1.5 lib/lifen/client.rb
lifen-0.1.4 lib/lifen/client.rb
lifen-0.1.3 lib/lifen/client.rb
lifen-0.1.2 lib/lifen/client.rb
lifen-0.1.1 lib/lifen/client.rb