-
-
Notifications
You must be signed in to change notification settings - Fork 224
Expand file tree
/
Copy pathconfig.rb
More file actions
54 lines (48 loc) · 1.17 KB
/
config.rb
File metadata and controls
54 lines (48 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# 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
store_scopes
].freeze
attr_accessor(*Config::ATTRIBUTES)
def reset
self.endpoint = 'https://slack.com/api/'
self.user_agent = "Slack Ruby Client/#{Slack::VERSION}"
self.ca_path = defined?(OpenSSL) ? OpenSSL::X509::DEFAULT_CERT_DIR : nil
self.ca_file = defined?(OpenSSL) ? OpenSSL::X509::DEFAULT_CERT_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
self.store_scopes = nil
end
end
class << self
def configure
block_given? ? yield(Config) : Config
end
def config
Config
end
end
end
end
Slack::Web::Config.reset