Sha256: d4722750dbcee75c395d27cb7512dda3d000f949b6f003d6cd8b3970edcaa601

Contents?: true

Size: 825 Bytes

Versions: 9

Compression:

Stored size: 825 Bytes

Contents

module Slack
  module Web
    module Config
      extend self

      ATTRIBUTES = [
        :proxy,
        :user_agent,
        :ca_path,
        :ca_file,
        :logger,
        :endpoint,
        :token
      ].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
      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

9 entries across 9 versions & 1 rubygems

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