Sha256: e630c0229f085d20c5cf9aa4b30b975fc401c89a91f10861e0882ea18ede4533

Contents?: true

Size: 1.01 KB

Versions: 11

Compression:

Stored size: 1.01 KB

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::Mashify, mash_class: Slack::Messages::Message
            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

11 entries across 11 versions & 1 rubygems

Version Path
slack-ruby-client-0.7.9 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.7.8 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.7.7 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.7.6 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.7.5 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.7.4 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.7.3 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.7.2 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.7.1 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.7.0 lib/slack/web/faraday/connection.rb
slack-ruby-client-0.6.0 lib/slack/web/faraday/connection.rb