Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
deprecation warnings removed
  • Loading branch information
ozayr-zaviar committed Oct 7, 2021
commit a0893b1a34ac53f1297e572535e4b812d99d3c37
27 changes: 0 additions & 27 deletions lib/optimizely.rb
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ def track(event_key, user_id, attributes = nil, event_tags = nil)

# Determine whether a feature is enabled.
# Sends an impression event if the user is bucketed into an experiment using the feature.
# @deprecated Use {#decide} methods of 'OptimizelyUserContext' instead.
#
# @param feature_flag_key - String unique key of the feature.
# @param user_id - String ID of the user.
Expand All @@ -480,8 +479,6 @@ def track(event_key, user_id, attributes = nil, event_tags = nil)
# @return [False] if the feature is not found.

def is_feature_enabled(feature_flag_key, user_id, attributes = nil)
@logger.log Logger::WARN, "'is_feature_enabled' is deprecated. Use 'decide' methods instead."

unless is_valid
@logger.log(Logger::ERROR, InvalidProjectConfigError.new('is_feature_enabled').message)
return false
Expand Down Expand Up @@ -557,15 +554,12 @@ def is_feature_enabled(feature_flag_key, user_id, attributes = nil)
end

# Gets keys of all feature flags which are enabled for the user.
# @deprecated Use {#decide} methods of 'OptimizelyUserContext' instead.
#
# @param user_id - ID for user.
# @param attributes - Dict representing user attributes.
# @return [feature flag keys] A List of feature flag keys that are enabled for the user.

def get_enabled_features(user_id, attributes = nil)
@logger.log Logger::WARN, "'get_enabled_features' is deprecated. Use 'decide' methods instead."

enabled_features = []
unless is_valid
@logger.log(Logger::ERROR, InvalidProjectConfigError.new('get_enabled_features').message)
Expand Down Expand Up @@ -593,7 +587,6 @@ def get_enabled_features(user_id, attributes = nil)
end

# Get the value of the specified variable in the feature flag.
# @deprecated Use {#decide} methods of 'OptimizelyUserContext' instead.
#
# @param feature_flag_key - String key of feature flag the variable belongs to
# @param variable_key - String key of variable for which we are getting the value
Expand All @@ -604,8 +597,6 @@ def get_enabled_features(user_id, attributes = nil)
# @return [nil] if the feature flag or variable are not found.

def get_feature_variable(feature_flag_key, variable_key, user_id, attributes = nil)
@logger.log Logger::WARN, "'get_feature_variable' is deprecated. Use 'decide' methods instead."

unless is_valid
@logger.log(Logger::ERROR, InvalidProjectConfigError.new('get_feature_variable').message)
return nil
Expand All @@ -622,7 +613,6 @@ def get_feature_variable(feature_flag_key, variable_key, user_id, attributes = n
end

# Get the String value of the specified variable in the feature flag.
# @deprecated Use {#decide} methods of 'OptimizelyUserContext' instead.
#
# @param feature_flag_key - String key of feature flag the variable belongs to
# @param variable_key - String key of variable for which we are getting the string value
Expand All @@ -633,8 +623,6 @@ def get_feature_variable(feature_flag_key, variable_key, user_id, attributes = n
# @return [nil] if the feature flag or variable are not found.

def get_feature_variable_string(feature_flag_key, variable_key, user_id, attributes = nil)
@logger.log Logger::WARN, "'get_feature_variable_string' is deprecated. Use 'decide' methods instead."

unless is_valid
@logger.log(Logger::ERROR, InvalidProjectConfigError.new('get_feature_variable_string').message)
return nil
Expand All @@ -651,7 +639,6 @@ def get_feature_variable_string(feature_flag_key, variable_key, user_id, attribu
end

# Get the Json value of the specified variable in the feature flag in a Dict.
# @deprecated Use {#decide} methods of 'OptimizelyUserContext' instead.
#
# @param feature_flag_key - String key of feature flag the variable belongs to
# @param variable_key - String key of variable for which we are getting the string value
Expand All @@ -662,8 +649,6 @@ def get_feature_variable_string(feature_flag_key, variable_key, user_id, attribu
# @return [nil] if the feature flag or variable are not found.

def get_feature_variable_json(feature_flag_key, variable_key, user_id, attributes = nil)
@logger.log Logger::WARN, "'get_feature_variable_json' is deprecated. Use 'decide' methods instead."

unless is_valid
@logger.log(Logger::ERROR, InvalidProjectConfigError.new('get_feature_variable_json').message)
return nil
Expand All @@ -680,7 +665,6 @@ def get_feature_variable_json(feature_flag_key, variable_key, user_id, attribute
end

# Get the Boolean value of the specified variable in the feature flag.
# @deprecated Use {#decide} methods of 'OptimizelyUserContext' instead.
#
# @param feature_flag_key - String key of feature flag the variable belongs to
# @param variable_key - String key of variable for which we are getting the string value
Expand All @@ -691,8 +675,6 @@ def get_feature_variable_json(feature_flag_key, variable_key, user_id, attribute
# @return [nil] if the feature flag or variable are not found.

def get_feature_variable_boolean(feature_flag_key, variable_key, user_id, attributes = nil)
@logger.log Logger::WARN, "'get_feature_variable_boolean' is deprecated. Use 'decide' methods instead."

unless is_valid
@logger.log(Logger::ERROR, InvalidProjectConfigError.new('get_feature_variable_boolean').message)
return nil
Expand All @@ -710,7 +692,6 @@ def get_feature_variable_boolean(feature_flag_key, variable_key, user_id, attrib
end

# Get the Double value of the specified variable in the feature flag.
# @deprecated Use {#decide} methods of 'OptimizelyUserContext' instead.
#
# @param feature_flag_key - String key of feature flag the variable belongs to
# @param variable_key - String key of variable for which we are getting the string value
Expand All @@ -721,8 +702,6 @@ def get_feature_variable_boolean(feature_flag_key, variable_key, user_id, attrib
# @return [nil] if the feature flag or variable are not found.

def get_feature_variable_double(feature_flag_key, variable_key, user_id, attributes = nil)
@logger.log Logger::WARN, "'get_feature_variable_double' is deprecated. Use 'decide' methods instead."

unless is_valid
@logger.log(Logger::ERROR, InvalidProjectConfigError.new('get_feature_variable_double').message)
return nil
Expand All @@ -740,7 +719,6 @@ def get_feature_variable_double(feature_flag_key, variable_key, user_id, attribu
end

# Get values of all the variables in the feature flag and returns them in a Dict
# @deprecated Use {#decide} methods of 'OptimizelyUserContext' instead.
#
# @param feature_flag_key - String key of feature flag
# @param user_id - String user ID
Expand All @@ -750,8 +728,6 @@ def get_feature_variable_double(feature_flag_key, variable_key, user_id, attribu
# @return [nil] if the feature flag is not found.

def get_all_feature_variables(feature_flag_key, user_id, attributes = nil)
@logger.log Logger::WARN, "'get_all_feature_variables' is deprecated. Use 'decide' methods instead."

unless is_valid
@logger.log(Logger::ERROR, InvalidProjectConfigError.new('get_all_feature_variables').message)
return nil
Expand Down Expand Up @@ -809,7 +785,6 @@ def get_all_feature_variables(feature_flag_key, user_id, attributes = nil)
end

# Get the Integer value of the specified variable in the feature flag.
# @deprecated Use {#decide} methods of 'OptimizelyUserContext' instead.
#
# @param feature_flag_key - String key of feature flag the variable belongs to
# @param variable_key - String key of variable for which we are getting the string value
Expand All @@ -820,8 +795,6 @@ def get_all_feature_variables(feature_flag_key, user_id, attributes = nil)
# @return [nil] if the feature flag or variable are not found.

def get_feature_variable_integer(feature_flag_key, variable_key, user_id, attributes = nil)
@logger.log Logger::WARN, "'get_feature_variable_integer' is deprecated. Use 'decide' methods instead."

unless is_valid
@logger.log(Logger::ERROR, InvalidProjectConfigError.new('get_feature_variable_integer').message)
return nil
Expand Down