Sha256: e28fe57ac86727ead5afda3b6711f2eff689c372ece575c05627acb914464faa

Contents?: true

Size: 775 Bytes

Versions: 4

Compression:

Stored size: 775 Bytes

Contents

module Slack
  module Web
    module Config
      extend self

      ATTRIBUTES = [
        :proxy,
        :user_agent,
        :ca_path,
        :ca_file,
        :endpoint,
        :token
      ]

      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
      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.4.0 lib/slack/web/config.rb
slack-ruby-client-0.3.1 lib/slack/web/config.rb
slack-ruby-client-0.3.0 lib/slack/web/config.rb
slack-ruby-client-0.2.1 lib/slack/web/config.rb