Sha256: 40cad00c2e74020b93336b9408ffb3b5b85f624430117679561ed790f6c15e6c

Contents?: true

Size: 936 Bytes

Versions: 7

Compression:

Stored size: 936 Bytes

Contents

module Slack
  module Web
    module Faraday
      module Connection
        private

        def connection
          options = {
            headers: { 'Accept' => 'application/json; charset=utf-8' }
          }

          options[:headers]['User-Agent'] = user_agent if user_agent
          options[:proxy] = proxy if proxy
          options[:ssl] = { ca_path: ca_path, ca_file: ca_file }

          ::Faraday::Connection.new(endpoint, options) do |connection|
            connection.use ::Faraday::Request::Multipart
            connection.use ::Faraday::Request::UrlEncoded
            connection.use ::Slack::Web::Faraday::Response::RaiseError
            connection.use ::FaradayMiddleware::ParseJson
            connection.use ::Faraday::Response::RaiseError
            connection.response :logger, logger if logger
            connection.adapter ::Faraday.default_adapter
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
slack-ruby-client-bhe-0.5.5 lib/slack/web/faraday/connection.rb
slack-ruby-client-bhe-0.5.4 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.5.4 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.5.3 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.5.2 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.5.1 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.5.0 lib/slack/web/faraday/connection.rb