Module: ConfigCat

Defined in:
lib/configcat.rb,
lib/configcat/user.rb,
lib/configcat/utils.rb,
lib/configcat/config.rb,
lib/configcat/version.rb,
lib/configcat/interfaces.rb,
lib/configcat/configcache.rb,
lib/configcat/configentry.rb,
lib/configcat/pollingmode.rb,
lib/configcat/configfetcher.rb,
lib/configcat/configservice.rb,
lib/configcat/refreshresult.rb,
lib/configcat/datagovernance.rb,
lib/configcat/configcatclient.rb,
lib/configcat/configcatlogger.rb,
lib/configcat/configcatoptions.rb,
lib/configcat/rolloutevaluator.rb,
lib/configcat/evaluationcontext.rb,
lib/configcat/evaluationdetails.rb,
lib/configcat/overridedatasource.rb,
lib/configcat/localfiledatasource.rb,
lib/configcat/evaluationlogbuilder.rb,
lib/configcat/localdictionarydatasource.rb

Defined Under Namespace

Modules: Comparator, Config, PrerequisiteComparator, SegmentComparator Classes: AutoPollingMode, ConfigCache, ConfigCatClient, ConfigCatClientException, ConfigCatLogger, ConfigCatOptions, ConfigEntry, ConfigFetcher, ConfigService, DataGovernance, EvaluationContext, EvaluationDetails, EvaluationLogBuilder, FetchResponse, FlagOverrides, Hooks, InMemoryConfigCache, KeyValue, LazyLoadingMode, LocalDictionaryDataSource, LocalDictionaryFlagOverrides, LocalFileDataSource, LocalFileFlagOverrides, ManualPollingMode, NullConfigCache, OverrideBehaviour, OverrideDataSource, PollingMode, RedirectMode, RefreshResult, RolloutEvaluator, SettingType, Status, User, Utils

Constant Summary collapse

CONFIG_FILE_NAME =
'config_v6'
SERIALIZATION_FORMAT_VERSION =
'v2'
PREFERENCES =

Config

'p'
SEGMENTS =
's'
FEATURE_FLAGS =
'f'
BASE_URL =

Preferences

'u'
REDIRECT =
'r'
SALT =
's'
SEGMENT_NAME =

Segment

'n'
SEGMENT_CONDITIONS =

The first 4 characters of the Segment’s name

'r'
COMPARISON_ATTRIBUTE =

Segment Condition (User Condition)

'a'
COMPARATOR =

The attribute of the user object that should be used to evaluate this rule

'c'
SETTING_TYPE =

Feature flag (Evaluation Formula)

't'
PERCENTAGE_RULE_ATTRIBUTE =

0 = bool, 1 = string, 2 = int, 3 = double

'a'
TARGETING_RULES =

Percentage rule evaluation hashes this attribute of the User object to calculate the buckets

'r'
PERCENTAGE_OPTIONS =

Targeting Rules (Logically connected by OR)

'p'
VALUE =

Percentage Options without conditions

'v'
VARIATION_ID =
'i'
INLINE_SALT =
'inline_salt'
CONDITIONS =

Targeting Rule (Evaluation Rule)

'c'
SERVED_VALUE =

Value and Variation ID

's'
TARGETING_RULE_PERCENTAGE_OPTIONS =
'p'
USER_CONDITION =

Condition

'u'
SEGMENT_CONDITION =

Segment targeting rule

's'
PREREQUISITE_FLAG_CONDITION =

Prerequisite flag targeting rule

'p'
SEGMENT_INDEX =

Segment Condition

's'
SEGMENT_COMPARATOR =
'c'
INLINE_SEGMENT =
'inline_segment'
PREREQUISITE_FLAG_KEY =

Prerequisite Flag Condition

'f'
PREREQUISITE_COMPARATOR =
'c'
PERCENTAGE =

Percentage Option

'p'
BOOL_VALUE =

Value

'b'
STRING_VALUE =
's'
INT_VALUE =
'i'
DOUBLE_VALUE =
'd'
STRING_LIST_VALUE =
'l'
UNSUPPORTED_VALUE =
'unsupported_value'
COMPARATOR_TEXTS =
[
  'IS ONE OF',                  # IS_ONE_OF
  'IS NOT ONE OF',              # IS_NOT_ONE_OF
  'CONTAINS ANY OF',            # CONTAINS_ANY_OF
  'NOT CONTAINS ANY OF',        # NOT_CONTAINS_ANY_OF
  'IS ONE OF',                  # IS_ONE_OF_SEMVER
  'IS NOT ONE OF',              # IS_NOT_ONE_OF_SEMVER
  '<',                          # LESS_THAN_SEMVER
  '<=',                         # LESS_THAN_OR_EQUAL_SEMVER
  '>',                          # GREATER_THAN_SEMVER
  '>=',                         # GREATER_THAN_OR_EQUAL_SEMVER
  '=',                          # EQUALS_NUMBER
  '!=',                         # NOT_EQUALS_NUMBER
  '<',                          # LESS_THAN_NUMBER
  '<=',                         # LESS_THAN_OR_EQUAL_NUMBER
  '>',                          # GREATER_THAN_NUMBER
  '>=',                         # GREATER_THAN_OR_EQUAL_NUMBER
  'IS ONE OF',                  # IS_ONE_OF_HASHED
  'IS NOT ONE OF',              # IS_NOT_ONE_OF_HASHED
  'BEFORE',                     # BEFORE_DATETIME
  'AFTER',                      # AFTER_DATETIME
  'EQUALS',                     # EQUALS_HASHED
  'NOT EQUALS',                 # NOT_EQUALS_HASHED
  'STARTS WITH ANY OF',         # STARTS_WITH_ANY_OF_HASHED
  'NOT STARTS WITH ANY OF',     # NOT_STARTS_WITH_ANY_OF_HASHED
  'ENDS WITH ANY OF',           # ENDS_WITH_ANY_OF_HASHED
  'NOT ENDS WITH ANY OF',       # NOT_ENDS_WITH_ANY_OF_HASHED
  'ARRAY CONTAINS ANY OF',      # ARRAY_CONTAINS_ANY_OF_HASHED
  'ARRAY NOT CONTAINS ANY OF',  # ARRAY_NOT_CONTAINS_ANY_OF_HASHED
  'EQUALS',                     # EQUALS
  'NOT EQUALS',                 # NOT_EQUALS
  'STARTS WITH ANY OF',         # STARTS_WITH_ANY_OF
  'NOT STARTS WITH ANY OF',     # NOT_STARTS_WITH_ANY_OF
  'ENDS WITH ANY OF',           # ENDS_WITH_ANY_OF
  'NOT ENDS WITH ANY OF',       # NOT_ENDS_WITH_ANY_OF
  'ARRAY CONTAINS ANY OF',      # ARRAY_CONTAINS_ANY_OF
  'ARRAY NOT CONTAINS ANY OF'   # ARRAY_NOT_CONTAINS_ANY_OF
]
COMPARISON_VALUES =
[
  STRING_LIST_VALUE,  # IS_ONE_OF
  STRING_LIST_VALUE,  # IS_NOT_ONE_OF
  STRING_LIST_VALUE,  # CONTAINS_ANY_OF
  STRING_LIST_VALUE,  # NOT_CONTAINS_ANY_OF
  STRING_LIST_VALUE,  # IS_ONE_OF_SEMVER
  STRING_LIST_VALUE,  # IS_NOT_ONE_OF_SEMVER
  STRING_VALUE,       # LESS_THAN_SEMVER
  STRING_VALUE,       # LESS_THAN_OR_EQUAL_SEMVER
  STRING_VALUE,       # GREATER_THAN_SEMVER
  STRING_VALUE,       # GREATER_THAN_OR_EQUAL_SEMVER
  DOUBLE_VALUE,       # EQUALS_NUMBER
  DOUBLE_VALUE,       # NOT_EQUALS_NUMBER
  DOUBLE_VALUE,       # LESS_THAN_NUMBER
  DOUBLE_VALUE,       # LESS_THAN_OR_EQUAL_NUMBER
  DOUBLE_VALUE,       # GREATER_THAN_NUMBER
  DOUBLE_VALUE,       # GREATER_THAN_OR_EQUAL_NUMBER
  STRING_LIST_VALUE,  # IS_ONE_OF_HASHED
  STRING_LIST_VALUE,  # IS_NOT_ONE_OF_HASHED
  DOUBLE_VALUE,       # BEFORE_DATETIME
  DOUBLE_VALUE,       # AFTER_DATETIME
  STRING_VALUE,       # EQUALS_HASHED
  STRING_VALUE,       # NOT_EQUALS_HASHED
  STRING_LIST_VALUE,  # STARTS_WITH_ANY_OF_HASHED
  STRING_LIST_VALUE,  # NOT_STARTS_WITH_ANY_OF_HASHED
  STRING_LIST_VALUE,  # ENDS_WITH_ANY_OF_HASHED
  STRING_LIST_VALUE,  # NOT_ENDS_WITH_ANY_OF_HASHED
  STRING_LIST_VALUE,  # ARRAY_CONTAINS_ANY_OF_HASHED
  STRING_LIST_VALUE,  # ARRAY_NOT_CONTAINS_ANY_OF_HASHED
  STRING_VALUE,       # EQUALS
  STRING_VALUE,       # NOT_EQUALS
  STRING_LIST_VALUE,  # STARTS_WITH_ANY_OF
  STRING_LIST_VALUE,  # NOT_STARTS_WITH_ANY_OF
  STRING_LIST_VALUE,  # ENDS_WITH_ANY_OF
  STRING_LIST_VALUE,  # NOT_ENDS_WITH_ANY_OF
  STRING_LIST_VALUE,  # ARRAY_CONTAINS_ANY_OF
  STRING_LIST_VALUE   # ARRAY_NOT_CONTAINS_ANY_OF
]
SEGMENT_COMPARATOR_TEXTS =
['IS IN SEGMENT', 'IS NOT IN SEGMENT']
PREREQUISITE_COMPARATOR_TEXTS =
['EQUALS', 'DOES NOT EQUAL']
VERSION =
"8.0.1"
BASE_URL_GLOBAL =
"https://cdn-global.configcat.com"
BASE_URL_EU_ONLY =
"https://cdn-eu.configcat.com"
BASE_PATH =
"configuration-files/"
BASE_EXTENSION =
"/" + CONFIG_FILE_NAME + ".json"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject

Returns the value of attribute logger.



11
12
13
# File 'lib/configcat.rb', line 11

def logger
  @logger
end

Class Method Details

.close_allObject

Closes all ConfigCatClient instances.



24
25
26
# File 'lib/configcat.rb', line 24

def ConfigCat.close_all
  ConfigCatClient.close_all
end

.get(sdk_key, options = nil) ⇒ Object

Creates a new or gets an already existing ‘ConfigCatClient` for the given `sdk_key`.

:param sdk_key [String] ConfigCat SDK Key to access your configuration. :param options [ConfigCatOptions] Configuration ‘ConfigCatOptions` for `ConfigCatClient`. :return [ConfigCatClient] the `ConfigCatClient` instance.



19
20
21
# File 'lib/configcat.rb', line 19

def ConfigCat.get(sdk_key, options = nil)
  return ConfigCatClient.get(sdk_key, options)
end