Module: ConfigCat
- Defined in:
- lib/configcat.rb,
lib/configcat/user.rb,
lib/configcat/version.rb,
lib/configcat/interfaces.rb,
lib/configcat/configcache.rb,
lib/configcat/configfetcher.rb,
lib/configcat/configcatclient.rb,
lib/configcat/rolloutevaluator.rb,
lib/configcat/autopollingcachepolicy.rb,
lib/configcat/lazyloadingcachepolicy.rb,
lib/configcat/manualpollingcachepolicy.rb
Defined Under Namespace
Classes: AutoPollingCachePolicy, CacheControlConfigFetcher, CachePolicy, ConfigCache, ConfigCatClient, ConfigCatClientException, ConfigFetcher, InMemoryConfigCache, LazyLoadingCachePolicy, ManualPollingCachePolicy, RolloutEvaluator, User
Constant Summary
collapse
- VERSION =
"1.0.1"
- BASE_URL =
"https://cdn.configcat.com"
- BASE_PATH =
"configuration-files/"
- BASE_EXTENSION =
"/config_v2.json"
Class Attribute Summary collapse
Class Method Summary
collapse
-
.create_client(api_key) ⇒ Object
-
.create_client_with_auto_poll(api_key, poll_interval_seconds: 60, max_init_wait_time_seconds: 5, on_configuration_changed_callback: nil, config_cache_class: nil, base_url: nil) ⇒ Object
-
.create_client_with_lazy_load(api_key, cache_time_to_live_seconds: 60, config_cache_class: nil, base_url: nil) ⇒ Object
-
.create_client_with_manual_poll(api_key, config_cache_class: nil, base_url: nil) ⇒ Object
Class Attribute Details
.logger ⇒ Object
Returns the value of attribute logger.
10
11
12
|
# File 'lib/configcat.rb', line 10
def logger
@logger
end
|
Class Method Details
.create_client(api_key) ⇒ Object
13
14
15
16
17
18
19
20
|
# File 'lib/configcat.rb', line 13
def ConfigCat.create_client(api_key)
return create_client_with_auto_poll(api_key)
end
|
.create_client_with_auto_poll(api_key, poll_interval_seconds: 60, max_init_wait_time_seconds: 5, on_configuration_changed_callback: nil, config_cache_class: nil, base_url: nil) ⇒ Object
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
|
# File 'lib/configcat.rb', line 22
def ConfigCat.create_client_with_auto_poll(api_key, poll_interval_seconds: 60, max_init_wait_time_seconds: 5, on_configuration_changed_callback: nil, config_cache_class: nil, base_url: nil)
if api_key === nil
raise ConfigCatClientException, "API Key is required."
end
if poll_interval_seconds < 1
poll_interval_seconds = 1
end
if max_init_wait_time_seconds < 0
max_init_wait_time_seconds = 0
end
return ConfigCatClient.new(api_key,
poll_interval_seconds: poll_interval_seconds,
max_init_wait_time_seconds: max_init_wait_time_seconds,
on_configuration_changed_callback: on_configuration_changed_callback,
cache_time_to_live_seconds: 0,
config_cache_class: config_cache_class,
base_url: base_url)
end
|
.create_client_with_lazy_load(api_key, cache_time_to_live_seconds: 60, config_cache_class: nil, base_url: nil) ⇒ Object
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/configcat.rb', line 52
def ConfigCat.create_client_with_lazy_load(api_key, cache_time_to_live_seconds: 60, config_cache_class: nil, base_url: nil)
if api_key === nil
raise ConfigCatClientException, "API Key is required."
end
if cache_time_to_live_seconds < 1
cache_time_to_live_seconds = 1
end
return ConfigCatClient.new(api_key,
poll_interval_seconds: 0,
max_init_wait_time_seconds: 0,
on_configuration_changed_callback: nil,
cache_time_to_live_seconds: cache_time_to_live_seconds,
config_cache_class: config_cache_class,
base_url: base_url)
end
|
.create_client_with_manual_poll(api_key, config_cache_class: nil, base_url: nil) ⇒ Object
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
# File 'lib/configcat.rb', line 77
def ConfigCat.create_client_with_manual_poll(api_key, config_cache_class: nil, base_url: nil)
if api_key === nil
raise ConfigCatClientException, "API Key is required."
end
return ConfigCatClient.new(api_key,
poll_interval_seconds: 0,
max_init_wait_time_seconds: 0,
on_configuration_changed_callback: nil,
cache_time_to_live_seconds: 0,
config_cache_class: config_cache_class,
base_url: base_url)
end
|