Class: Kameleoon::Targeting::ExclusiveFeatureFlagCondition Private

Inherits:
Condition
  • Object
show all
Defined in:
lib/kameleoon/targeting/conditions/exclusive_feature_flag_condition.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

ExclusiveExperiment represents an instance of Exclusive Experiment condition in user account

Instance Attribute Summary

Attributes inherited from Condition

#id, #include, #type

Instance Method Summary collapse

Methods inherited from Condition

#initialize

Constructor Details

This class inherits a constructor from Kameleoon::Targeting::Condition

Instance Method Details

#check(data) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



10
11
12
13
14
15
# File 'lib/kameleoon/targeting/conditions/exclusive_feature_flag_condition.rb', line 10

def check(data)
  return false unless data.is_a?(ExclusiveFeatureFlagInfo)

  size = data.variations_storage&.size || 0
  size.zero? || (size == 1 && !data.variations_storage.get(data.current_experiment_id).nil?)
end