Class: Gitlab::Experimentation::Experiment
- Inherits:
-
Struct
- Object
- Struct
- Gitlab::Experimentation::Experiment
- Defined in:
- lib/gitlab/experimentation.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#key ⇒ Object
Returns the value of attribute key.
-
#tracking_category ⇒ Object
Returns the value of attribute tracking_category.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
- #enabled_for_environment? ⇒ Boolean
- #enabled_for_experimentation_subject?(experimentation_subject_index) ⇒ Boolean
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment
192 193 194 |
# File 'lib/gitlab/experimentation.rb', line 192 def environment @environment end |
#key ⇒ Object
Returns the value of attribute key
192 193 194 |
# File 'lib/gitlab/experimentation.rb', line 192 def key @key end |
#tracking_category ⇒ Object
Returns the value of attribute tracking_category
192 193 194 |
# File 'lib/gitlab/experimentation.rb', line 192 def tracking_category @tracking_category end |
Instance Method Details
#enabled? ⇒ Boolean
193 194 195 |
# File 'lib/gitlab/experimentation.rb', line 193 def enabled? experiment_percentage > 0 end |
#enabled_for_environment? ⇒ Boolean
197 198 199 200 201 |
# File 'lib/gitlab/experimentation.rb', line 197 def enabled_for_environment? return ::Gitlab.dev_env_or_com? if environment.nil? environment end |
#enabled_for_experimentation_subject?(experimentation_subject_index) ⇒ Boolean
203 204 205 206 207 |
# File 'lib/gitlab/experimentation.rb', line 203 def enabled_for_experimentation_subject?(experimentation_subject_index) return false if experimentation_subject_index.blank? experimentation_subject_index <= experiment_percentage end |