optimizely-sdk 3.10.1 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +202 -202
- data/lib/optimizely/audience.rb +127 -97
- data/lib/optimizely/bucketer.rb +156 -156
- data/lib/optimizely/condition_tree_evaluator.rb +123 -123
- data/lib/optimizely/config/datafile_project_config.rb +539 -552
- data/lib/optimizely/config/proxy_config.rb +34 -34
- data/lib/optimizely/config_manager/async_scheduler.rb +95 -95
- data/lib/optimizely/config_manager/http_project_config_manager.rb +330 -329
- data/lib/optimizely/config_manager/project_config_manager.rb +24 -24
- data/lib/optimizely/config_manager/static_project_config_manager.rb +53 -52
- data/lib/optimizely/decide/optimizely_decide_option.rb +28 -28
- data/lib/optimizely/decide/optimizely_decision.rb +60 -60
- data/lib/optimizely/decide/optimizely_decision_message.rb +26 -26
- data/lib/optimizely/decision_service.rb +563 -563
- data/lib/optimizely/error_handler.rb +39 -39
- data/lib/optimizely/event/batch_event_processor.rb +235 -234
- data/lib/optimizely/event/entity/conversion_event.rb +44 -43
- data/lib/optimizely/event/entity/decision.rb +38 -38
- data/lib/optimizely/event/entity/event_batch.rb +86 -86
- data/lib/optimizely/event/entity/event_context.rb +50 -50
- data/lib/optimizely/event/entity/impression_event.rb +48 -47
- data/lib/optimizely/event/entity/snapshot.rb +33 -33
- data/lib/optimizely/event/entity/snapshot_event.rb +48 -48
- data/lib/optimizely/event/entity/user_event.rb +22 -22
- data/lib/optimizely/event/entity/visitor.rb +36 -35
- data/lib/optimizely/event/entity/visitor_attribute.rb +38 -37
- data/lib/optimizely/event/event_factory.rb +156 -155
- data/lib/optimizely/event/event_processor.rb +25 -25
- data/lib/optimizely/event/forwarding_event_processor.rb +44 -43
- data/lib/optimizely/event/user_event_factory.rb +88 -88
- data/lib/optimizely/event_builder.rb +221 -228
- data/lib/optimizely/event_dispatcher.rb +71 -71
- data/lib/optimizely/exceptions.rb +135 -139
- data/lib/optimizely/helpers/constants.rb +415 -397
- data/lib/optimizely/helpers/date_time_utils.rb +30 -30
- data/lib/optimizely/helpers/event_tag_utils.rb +132 -132
- data/lib/optimizely/helpers/group.rb +31 -31
- data/lib/optimizely/helpers/http_utils.rb +65 -64
- data/lib/optimizely/helpers/validator.rb +183 -183
- data/lib/optimizely/helpers/variable_type.rb +67 -67
- data/lib/optimizely/logger.rb +46 -45
- data/lib/optimizely/notification_center.rb +174 -176
- data/lib/optimizely/optimizely_config.rb +271 -272
- data/lib/optimizely/optimizely_factory.rb +181 -181
- data/lib/optimizely/optimizely_user_context.rb +204 -179
- data/lib/optimizely/params.rb +31 -31
- data/lib/optimizely/project_config.rb +99 -91
- data/lib/optimizely/semantic_version.rb +166 -166
- data/lib/optimizely/{custom_attribute_condition_evaluator.rb → user_condition_evaluator.rb} +391 -369
- data/lib/optimizely/user_profile_service.rb +35 -35
- data/lib/optimizely/version.rb +21 -21
- data/lib/optimizely.rb +1130 -1145
- metadata +15 -14
@@ -1,179 +1,204 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
#
|
4
|
-
# Copyright 2020-2022, Optimizely and contributors
|
5
|
-
#
|
6
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
-
# you may not use this file except in compliance with the License.
|
8
|
-
# You may obtain a copy of the License at
|
9
|
-
#
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
12
|
-
# Unless required by applicable law or agreed to in writing, software
|
13
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
# See the License for the specific language governing permissions and
|
16
|
-
# limitations under the License.
|
17
|
-
#
|
18
|
-
|
19
|
-
require 'json'
|
20
|
-
|
21
|
-
module Optimizely
|
22
|
-
class OptimizelyUserContext
|
23
|
-
# Representation of an Optimizely User Context using which APIs are to be called.
|
24
|
-
|
25
|
-
attr_reader :user_id
|
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
|
-
# @param
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
# @param
|
66
|
-
#
|
67
|
-
#
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
# @param
|
80
|
-
#
|
81
|
-
#
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
#
|
99
|
-
#
|
100
|
-
# @param
|
101
|
-
#
|
102
|
-
#
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
decision =
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
#
|
123
|
-
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
#
|
150
|
-
#
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
#
|
161
|
-
#
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Copyright 2020-2022, Optimizely and contributors
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'json'
|
20
|
+
|
21
|
+
module Optimizely
|
22
|
+
class OptimizelyUserContext
|
23
|
+
# Representation of an Optimizely User Context using which APIs are to be called.
|
24
|
+
|
25
|
+
attr_reader :user_id, :forced_decisions, :optimizely_client
|
26
|
+
|
27
|
+
OptimizelyDecisionContext = Struct.new(:flag_key, :rule_key)
|
28
|
+
OptimizelyForcedDecision = Struct.new(:variation_key)
|
29
|
+
def initialize(optimizely_client, user_id, user_attributes)
|
30
|
+
@attr_mutex = Mutex.new
|
31
|
+
@forced_decision_mutex = Mutex.new
|
32
|
+
@qualified_segment_mutex = Mutex.new
|
33
|
+
@optimizely_client = optimizely_client
|
34
|
+
@user_id = user_id
|
35
|
+
@user_attributes = user_attributes.nil? ? {} : user_attributes.clone
|
36
|
+
@forced_decisions = {}
|
37
|
+
@qualified_segments = []
|
38
|
+
end
|
39
|
+
|
40
|
+
def clone
|
41
|
+
user_context = OptimizelyUserContext.new(@optimizely_client, @user_id, user_attributes)
|
42
|
+
@forced_decision_mutex.synchronize { user_context.instance_variable_set('@forced_decisions', @forced_decisions.dup) unless @forced_decisions.empty? }
|
43
|
+
@qualified_segment_mutex.synchronize { user_context.instance_variable_set('@qualified_segments', @qualified_segments.dup) unless @qualified_segments.empty? }
|
44
|
+
user_context
|
45
|
+
end
|
46
|
+
|
47
|
+
def user_attributes
|
48
|
+
@attr_mutex.synchronize { @user_attributes.clone }
|
49
|
+
end
|
50
|
+
|
51
|
+
# Set an attribute for a given key
|
52
|
+
#
|
53
|
+
# @param key - An attribute key
|
54
|
+
# @param value - An attribute value
|
55
|
+
|
56
|
+
def set_attribute(attribute_key, attribute_value)
|
57
|
+
@attr_mutex.synchronize { @user_attributes[attribute_key] = attribute_value }
|
58
|
+
end
|
59
|
+
|
60
|
+
# Returns a decision result (OptimizelyDecision) for a given flag key and a user context, which contains all data required to deliver the flag.
|
61
|
+
#
|
62
|
+
# If the SDK finds an error, it'll return a `decision` with nil for `variation_key`. The decision will include an error message in `reasons`
|
63
|
+
#
|
64
|
+
# @param key -A flag key for which a decision will be made
|
65
|
+
# @param options - A list of options for decision making.
|
66
|
+
#
|
67
|
+
# @return [OptimizelyDecision] A decision result
|
68
|
+
|
69
|
+
def decide(key, options = nil)
|
70
|
+
@optimizely_client&.decide(clone, key, options)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Returns a hash of decision results (OptimizelyDecision) for multiple flag keys and a user context.
|
74
|
+
#
|
75
|
+
# If the SDK finds an error for a key, the response will include a decision for the key showing `reasons` for the error.
|
76
|
+
# The SDK will always return hash of decisions. When it can not process requests, it'll return an empty hash after logging the errors.
|
77
|
+
#
|
78
|
+
# @param keys - A list of flag keys for which the decisions will be made.
|
79
|
+
# @param options - A list of options for decision making.
|
80
|
+
#
|
81
|
+
# @return - Hash of decisions containing flag keys as hash keys and corresponding decisions as their values.
|
82
|
+
|
83
|
+
def decide_for_keys(keys, options = nil)
|
84
|
+
@optimizely_client&.decide_for_keys(clone, keys, options)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Returns a hash of decision results (OptimizelyDecision) for all active flag keys.
|
88
|
+
#
|
89
|
+
# @param options - A list of options for decision making.
|
90
|
+
#
|
91
|
+
# @return - Hash of decisions containing flag keys as hash keys and corresponding decisions as their values.
|
92
|
+
|
93
|
+
def decide_all(options = nil)
|
94
|
+
@optimizely_client&.decide_all(clone, options)
|
95
|
+
end
|
96
|
+
|
97
|
+
# Sets the forced decision (variation key) for a given flag and an optional rule.
|
98
|
+
#
|
99
|
+
# @param context - An OptimizelyDecisionContext object containg flag key and rule key.
|
100
|
+
# @param decision - An OptimizelyForcedDecision object containing variation key
|
101
|
+
#
|
102
|
+
# @return - true if the forced decision has been set successfully.
|
103
|
+
|
104
|
+
def set_forced_decision(context, decision)
|
105
|
+
flag_key = context[:flag_key]
|
106
|
+
return false if flag_key.nil?
|
107
|
+
|
108
|
+
@forced_decision_mutex.synchronize { @forced_decisions[context] = decision }
|
109
|
+
|
110
|
+
true
|
111
|
+
end
|
112
|
+
|
113
|
+
def find_forced_decision(context)
|
114
|
+
return nil if @forced_decisions.empty?
|
115
|
+
|
116
|
+
decision = nil
|
117
|
+
@forced_decision_mutex.synchronize { decision = @forced_decisions[context] }
|
118
|
+
decision
|
119
|
+
end
|
120
|
+
|
121
|
+
# Returns the forced decision for a given flag and an optional rule.
|
122
|
+
#
|
123
|
+
# @param context - An OptimizelyDecisionContext object containg flag key and rule key.
|
124
|
+
#
|
125
|
+
# @return - A variation key or nil if forced decisions are not set for the parameters.
|
126
|
+
|
127
|
+
def get_forced_decision(context)
|
128
|
+
find_forced_decision(context)
|
129
|
+
end
|
130
|
+
|
131
|
+
# Removes the forced decision for a given flag and an optional rule.
|
132
|
+
#
|
133
|
+
# @param context - An OptimizelyDecisionContext object containg flag key and rule key.
|
134
|
+
#
|
135
|
+
# @return - true if the forced decision has been removed successfully.
|
136
|
+
|
137
|
+
def remove_forced_decision(context)
|
138
|
+
deleted = false
|
139
|
+
@forced_decision_mutex.synchronize do
|
140
|
+
if @forced_decisions.key?(context)
|
141
|
+
@forced_decisions.delete(context)
|
142
|
+
deleted = true
|
143
|
+
end
|
144
|
+
end
|
145
|
+
deleted
|
146
|
+
end
|
147
|
+
|
148
|
+
# Removes all forced decisions bound to this user context.
|
149
|
+
#
|
150
|
+
# @return - true if forced decisions have been removed successfully.
|
151
|
+
|
152
|
+
def remove_all_forced_decisions
|
153
|
+
return false if @optimizely_client&.get_optimizely_config.nil?
|
154
|
+
|
155
|
+
@forced_decision_mutex.synchronize { @forced_decisions.clear }
|
156
|
+
true
|
157
|
+
end
|
158
|
+
|
159
|
+
# Track an event
|
160
|
+
#
|
161
|
+
# @param event_key - Event key representing the event which needs to be recorded.
|
162
|
+
|
163
|
+
def track_event(event_key, event_tags = nil)
|
164
|
+
@optimizely_client&.track(event_key, @user_id, user_attributes, event_tags)
|
165
|
+
end
|
166
|
+
|
167
|
+
def as_json
|
168
|
+
{
|
169
|
+
user_id: @user_id,
|
170
|
+
attributes: @user_attributes
|
171
|
+
}
|
172
|
+
end
|
173
|
+
|
174
|
+
def to_json(*args)
|
175
|
+
as_json.to_json(*args)
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns An array of qualified segments for this user
|
179
|
+
#
|
180
|
+
# @return - An array of segments names.
|
181
|
+
|
182
|
+
def qualified_segments
|
183
|
+
@qualified_segment_mutex.synchronize { @qualified_segments.clone }
|
184
|
+
end
|
185
|
+
|
186
|
+
# Replace qualified segments with provided segments
|
187
|
+
#
|
188
|
+
# @param segments - An array of segment names
|
189
|
+
|
190
|
+
def qualified_segments=(segments)
|
191
|
+
@qualified_segment_mutex.synchronize { @qualified_segments = segments.clone }
|
192
|
+
end
|
193
|
+
|
194
|
+
# Checks if user is qualified for the provided segment.
|
195
|
+
#
|
196
|
+
# @param segment - A segment name
|
197
|
+
|
198
|
+
def qualified_for?(segment)
|
199
|
+
return false if @qualified_segments.empty?
|
200
|
+
|
201
|
+
@qualified_segment_mutex.synchronize { @qualified_segments.include?(segment) }
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
data/lib/optimizely/params.rb
CHANGED
@@ -1,31 +1,31 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
#
|
4
|
-
# Copyright 2016-2017, Optimizely and contributors
|
5
|
-
#
|
6
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
-
# you may not use this file except in compliance with the License.
|
8
|
-
# You may obtain a copy of the License at
|
9
|
-
#
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
12
|
-
# Unless required by applicable law or agreed to in writing, software
|
13
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
# See the License for the specific language governing permissions and
|
16
|
-
# limitations under the License.
|
17
|
-
#
|
18
|
-
module Optimizely
|
19
|
-
class Params
|
20
|
-
ACCOUNT_ID = 'd'
|
21
|
-
PROJECT_ID = 'a'
|
22
|
-
EXPERIMENT_PREFIX = 'x'
|
23
|
-
GOAL_ID = 'g'
|
24
|
-
GOAL_NAME = 'n'
|
25
|
-
SEGMENT_PREFIX = 's'
|
26
|
-
END_USER_ID = 'u'
|
27
|
-
EVENT_VALUE = 'v'
|
28
|
-
SOURCE = 'src'
|
29
|
-
TIME = 'time'
|
30
|
-
end
|
31
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Copyright 2016-2017, Optimizely and contributors
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
module Optimizely
|
19
|
+
class Params
|
20
|
+
ACCOUNT_ID = 'd'
|
21
|
+
PROJECT_ID = 'a'
|
22
|
+
EXPERIMENT_PREFIX = 'x'
|
23
|
+
GOAL_ID = 'g'
|
24
|
+
GOAL_NAME = 'n'
|
25
|
+
SEGMENT_PREFIX = 's'
|
26
|
+
END_USER_ID = 'u'
|
27
|
+
EVENT_VALUE = 'v'
|
28
|
+
SOURCE = 'src'
|
29
|
+
TIME = 'time'
|
30
|
+
end
|
31
|
+
end
|
@@ -1,91 +1,99 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright 2016-2021, Optimizely and contributors
|
4
|
-
#
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
# you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
16
|
-
#
|
17
|
-
|
18
|
-
module Optimizely
|
19
|
-
class ProjectConfig
|
20
|
-
# ProjectConfig is an interface capturing the experiment, variation and feature definitions.
|
21
|
-
# The default implementation of ProjectConfig can be found in DatafileProjectConfig.
|
22
|
-
|
23
|
-
def datafile; end
|
24
|
-
|
25
|
-
def account_id; end
|
26
|
-
|
27
|
-
def attributes; end
|
28
|
-
|
29
|
-
def audiences; end
|
30
|
-
|
31
|
-
def typed_audiences; end
|
32
|
-
|
33
|
-
def events; end
|
34
|
-
|
35
|
-
def experiments; end
|
36
|
-
|
37
|
-
def feature_flags; end
|
38
|
-
|
39
|
-
def groups; end
|
40
|
-
|
41
|
-
def project_id; end
|
42
|
-
|
43
|
-
def anonymize_ip; end
|
44
|
-
|
45
|
-
def bot_filtering; end
|
46
|
-
|
47
|
-
def revision; end
|
48
|
-
|
49
|
-
def sdk_key; end
|
50
|
-
|
51
|
-
def environment_key; end
|
52
|
-
|
53
|
-
def send_flag_decisions; end
|
54
|
-
|
55
|
-
def rollouts; end
|
56
|
-
|
57
|
-
def
|
58
|
-
|
59
|
-
def
|
60
|
-
|
61
|
-
def
|
62
|
-
|
63
|
-
def
|
64
|
-
|
65
|
-
def
|
66
|
-
|
67
|
-
def
|
68
|
-
|
69
|
-
def
|
70
|
-
|
71
|
-
def
|
72
|
-
|
73
|
-
def
|
74
|
-
|
75
|
-
def
|
76
|
-
|
77
|
-
def
|
78
|
-
|
79
|
-
def
|
80
|
-
|
81
|
-
def
|
82
|
-
|
83
|
-
def
|
84
|
-
|
85
|
-
def
|
86
|
-
|
87
|
-
def
|
88
|
-
|
89
|
-
def
|
90
|
-
|
91
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2016-2021, Optimizely and contributors
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
module Optimizely
|
19
|
+
class ProjectConfig
|
20
|
+
# ProjectConfig is an interface capturing the experiment, variation and feature definitions.
|
21
|
+
# The default implementation of ProjectConfig can be found in DatafileProjectConfig.
|
22
|
+
|
23
|
+
def datafile; end
|
24
|
+
|
25
|
+
def account_id; end
|
26
|
+
|
27
|
+
def attributes; end
|
28
|
+
|
29
|
+
def audiences; end
|
30
|
+
|
31
|
+
def typed_audiences; end
|
32
|
+
|
33
|
+
def events; end
|
34
|
+
|
35
|
+
def experiments; end
|
36
|
+
|
37
|
+
def feature_flags; end
|
38
|
+
|
39
|
+
def groups; end
|
40
|
+
|
41
|
+
def project_id; end
|
42
|
+
|
43
|
+
def anonymize_ip; end
|
44
|
+
|
45
|
+
def bot_filtering; end
|
46
|
+
|
47
|
+
def revision; end
|
48
|
+
|
49
|
+
def sdk_key; end
|
50
|
+
|
51
|
+
def environment_key; end
|
52
|
+
|
53
|
+
def send_flag_decisions; end
|
54
|
+
|
55
|
+
def rollouts; end
|
56
|
+
|
57
|
+
def integrations; end
|
58
|
+
|
59
|
+
def public_key_for_odp; end
|
60
|
+
|
61
|
+
def host_for_odp; end
|
62
|
+
|
63
|
+
def all_segments; end
|
64
|
+
|
65
|
+
def experiment_running?(experiment); end
|
66
|
+
|
67
|
+
def get_experiment_from_key(experiment_key); end
|
68
|
+
|
69
|
+
def get_experiment_from_id(experiment_id); end
|
70
|
+
|
71
|
+
def get_experiment_key(experiment_id); end
|
72
|
+
|
73
|
+
def get_event_from_key(event_key); end
|
74
|
+
|
75
|
+
def get_audience_from_id(audience_id); end
|
76
|
+
|
77
|
+
def get_variation_from_id(experiment_key, variation_id); end
|
78
|
+
|
79
|
+
def get_variation_from_id_by_experiment_id(experiment_id, variation_id); end
|
80
|
+
|
81
|
+
def get_variation_id_from_key_by_experiment_id(experiment_id, variation_key); end
|
82
|
+
|
83
|
+
def get_variation_id_from_key(experiment_key, variation_key); end
|
84
|
+
|
85
|
+
def get_whitelisted_variations(experiment_id); end
|
86
|
+
|
87
|
+
def get_attribute_id(attribute_key); end
|
88
|
+
|
89
|
+
def variation_id_exists?(experiment_id, variation_id); end
|
90
|
+
|
91
|
+
def get_feature_flag_from_key(feature_flag_key); end
|
92
|
+
|
93
|
+
def get_feature_variable(feature_flag, variable_key); end
|
94
|
+
|
95
|
+
def get_rollout_from_id(rollout_id); end
|
96
|
+
|
97
|
+
def feature_experiment?(experiment_id); end
|
98
|
+
end
|
99
|
+
end
|