Sha256: 0d39ec7aba4c3f43092a1242b53e5e324222441d2a2a8ecbb0169add2fd0fd57
Contents?: true
Size: 1.37 KB
Versions: 6
Compression:
Stored size: 1.37 KB
Contents
# frozen_string_literal: true module Slack module Web module Faraday module Connection private def connection @connection ||= begin 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 } if ca_path || ca_file request_options = {} request_options[:timeout] = timeout if timeout request_options[:open_timeout] = open_timeout if open_timeout options[:request] = request_options if request_options.any? ::Faraday::Connection.new(endpoint, options) do |connection| connection.request :multipart connection.request :url_encoded connection.use ::Slack::Web::Faraday::Response::RaiseError connection.response :mashify, mash_class: Slack::Messages::Message connection.response :json, content_type: /\b*$/ connection.use ::Slack::Web::Faraday::Response::WrapError connection.response :logger, logger if logger connection.adapter adapter end end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems