Sha256: 184ec18d15cd2af4f5929f536798ae9051c575ad4e73b1922b1206638bb75448

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true
module Slack
  module Web
    module Config
      extend self

      ATTRIBUTES = %i[
        proxy
        user_agent
        ca_path
        ca_file
        logger
        endpoint
        token
        timeout
        open_timeout
        default_page_size
        default_max_retries
        adapter
      ].freeze

      attr_accessor(*Config::ATTRIBUTES)

      def reset
        self.endpoint = 'https://slack.com/api/'
        self.user_agent = "Slack Ruby Client/#{Slack::VERSION}"
        self.ca_path = nil
        self.ca_file = nil
        self.token = nil
        self.proxy = nil
        self.logger = nil
        self.timeout = nil
        self.open_timeout = nil
        self.default_page_size = 100
        self.default_max_retries = 100
        self.adapter = ::Faraday.default_adapter
      end
    end

    class << self
      def configure
        block_given? ? yield(Config) : Config
      end

      def config
        Config
      end
    end
  end
end

Slack::Web::Config.reset

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
slack-ruby-client-2.4.0 lib/slack/web/config.rb
slack-ruby-client-2.3.0 lib/slack/web/config.rb
slack-ruby-client-2.2.0 lib/slack/web/config.rb
slack-ruby-client-2.1.0 lib/slack/web/config.rb
slack-ruby-client-2.0.0 lib/slack/web/config.rb