lib/vwo/services/segment_evaluator.rb
# Evaluates the custom_variables passed against the pre-segmentation condition defined
# in the corresponding campaign.
#
# @param[String]                  :campaign_key         Running_campaign's key
# @param[String]                  :user_id              Unique user identifier
# @param[Hash]                    :dsl                  Segments provided in the settings_file
# @param[Hash]                    :custom_variables     Custom variables provided in the apis
# @param[Boolean]                 :disable_logs         disable logs if True
#
# @return[Boolean]                true if user passed pre-segmentation, else false
#
Evaluates the custom_variables passed against the pre-segmentation condition defined
in the corresponding campaign.
Evaluates the custom_variables passed against the pre - segmentation condition defined in the corresponding campaign .
def evaluate(campaign_key, user_id, dsl, custom_variables, disable_logs = false)
        result = evaluate_util(dsl, custom_variables) if valid_value?(dsl)
        result
      rescue StandardError => e
        @logger.log(
          LogLevelEnum::ERROR,
          format(
            LogMessageEnum::ErrorMessages::SEGMENTATION_ERROR,
            file: FileNameEnum::SegmentEvaluator,
            user_id: user_id,
            campaign_key: campaign_key,
            custom_variables: custom_variables,
            error_message: e
          ),
          disable_logs
        )
        false
      end
def evaluate ( campaign_key , user_id , dsl , custom_variables , disable_logs = false ) result = evaluate_util ( dsl , custom_variables ) if valid_value? ( dsl ) result rescue StandardError => e @logger . log ( LogLevelEnum :: ERROR , format ( LogMessageEnum :: ErrorMessages :: SEGMENTATION_ERROR , file : FileNameEnum :: SegmentEvaluator , user_id : user_id , campaign_key : campaign_key , custom_variables : custom_variables , error_message : e ) , disable_logs ) false end
Evaluates the custom_variables passed against the pre-segmentation condition defined
in the corresponding campaign.
Evaluates the custom_variables passed against the pre - segmentation condition defined in the corresponding campaign .
campaign_key
<not_specific>
user_id
<not_specific>
dsl
<not_specific>
custom_variables
<not_specific>
disable_logs
<not_specific>
param[String]
:campaign_key Running_campaign's key
: campaign_key Running_campaign ' s key
param[String]
:user_id Unique user identifier
: user_id Unique user identifier
param[Hash]
:dsl Segments provided in the settings_file
: dsl Segments provided in the settings_file
param[Hash]
:custom_variables Custom variables provided in the apis
: custom_variables Custom variables provided in the apis
param[Boolean]
:disable_logs disable logs if True
: disable_logs disable logs if True
return[Boolean]
true if user passed pre-segmentation, else false
true if user passed pre - segmentation else false