Sha256: 583795d33d58649eadaf4e77fc9f6888444b48585a45e23ead85779f5e05355d

Contents?: true

Size: 925 Bytes

Versions: 4

Compression:

Stored size: 925 Bytes

Contents

module Slack
  module Web
    module Config
      extend self

      ATTRIBUTES = [
        :proxy,
        :user_agent,
        :ca_path,
        :ca_file,
        :logger,
        :endpoint,
        :token,
        :timeout,
        :open_timeout
      ].freeze

      attr_accessor(*Config::ATTRIBUTES)

      def reset
        self.endpoint = 'https://slack.com/api/'
        self.user_agent = "Slack Ruby Client/#{Slack::VERSION}"
        self.ca_path = `openssl version -a | grep OPENSSLDIR | awk '{print $2}'|sed -e 's/\"//g'`
        self.ca_file = "#{ca_path}/ca-certificates.crt"
        self.token = nil
        self.proxy = nil
        self.logger = nil
        self.timeout = nil
        self.open_timeout = nil
      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

4 entries across 4 versions & 1 rubygems

Version Path
slack-ruby-client-0.9.1 lib/slack/web/config.rb
slack-ruby-client-0.9.0 lib/slack/web/config.rb
slack-ruby-client-0.8.1 lib/slack/web/config.rb
slack-ruby-client-0.8.0 lib/slack/web/config.rb