Sha256: c16fd1a8e136e626489fb458939d4c5fe604de856da7844d046960b8814c074c

Contents?: true

Size: 850 Bytes

Versions: 13

Compression:

Stored size: 850 Bytes

Contents

require 'faraday_middleware'
Dir[File.expand_path('../../faraday/*.rb', __FILE__)].each{|f| require f}

module Slack
  # @private
  module Connection
    private

    def connection
      options = {
        :headers => {'Accept' => "application/json; charset=utf-8", 'User-Agent' => user_agent},
        :proxy => proxy,
        :url => endpoint,
        :ssl => { :ca_path => ca_path, :ca_file => ca_file },
      }

      Faraday::Connection.new(options) do |connection|
        Array(middlewares).each do |middleware|
          connection.use middleware
        end
        connection.use Faraday::Request::Multipart
        connection.use Faraday::Request::UrlEncoded
        connection.use Faraday::Response::ParseJson
        connection.use FaradayMiddleware::RaiseHttpException
        connection.adapter(adapter)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
slack-api-1.6.1 lib/slack/connection.rb
slack-api-1.6.0 lib/slack/connection.rb
slack-api-1.5.0 lib/slack/connection.rb
slack-api-1.4.0 lib/slack/connection.rb
slack-api-1.3.0 lib/slack/connection.rb
slack-api-1.2.4 lib/slack/connection.rb
slack-api-1.2.3 lib/slack/connection.rb
slack-api-1.2.2 lib/slack/connection.rb
slack-web-api-0.0.1 lib/slack/connection.rb
slack-api-1.2.1 lib/slack/connection.rb
slack-api-1.2.0 lib/slack/connection.rb
slack-api-1.1.6 lib/slack/connection.rb
slack-api-1.1.4 lib/slack/connection.rb