lib/vwo/utils/segment.rb
# Extracts true values represented in the args, and returns stringified value of it
#
# @param [String]             :operator_value                 operand/dsl leaf value
# @param [String|Number]      :custom_variables_value         custom_variables value
# @return [[String, String]]  tuple of str value of operator_value, custom_variables_value converted
#                             into their true types
Extracts true values represented in the args, and returns stringified value of it
Extracts true values represented in the args and returns stringified value of it
def convert_to_true_types(operator_value, custom_variables_value)
        begin
          true_type_operator_value = Kernel::Float(operator_value)
          true_type_custom_variables_value = Kernel::Float(custom_variables_value)
        rescue StandardError => _e
          return operator_value, custom_variables_value
        end
        true_type_operator_value = true_type_operator_value.to_i if true_type_operator_value == true_type_operator_value.floor
        true_type_custom_variables_value = true_type_custom_variables_value.to_i if true_type_custom_variables_value == true_type_custom_variables_value.floor
        [true_type_operator_value.to_s, true_type_custom_variables_value.to_s]
      end
def convert_to_true_types ( operator_value , custom_variables_value ) begin true_type_operator_value = Kernel :: Float ( operator_value ) true_type_custom_variables_value = Kernel :: Float ( custom_variables_value ) rescue StandardError => _e return operator_value , custom_variables_value end true_type_operator_value = true_type_operator_value . to_i if true_type_operator_value == true_type_operator_value . floor true_type_custom_variables_value = true_type_custom_variables_value . to_i if true_type_custom_variables_value == true_type_custom_variables_value . floor [ true_type_operator_value . to_s , true_type_custom_variables_value . to_s ] end
Extracts true values represented in the args, and returns stringified value of it
Extracts true values represented in the args and returns stringified value of it
# This is atomic, either both values will be processed or none # Now both are float, So, convert them independently to int type if they are int rather than floats # Convert them back to string and return
] tuple of str value of operator_value, custom_variables_value converted into their true types
] tuple of str value of operator_value custom_variables_value converted into their true types
[String, String
operator_value
<not_specific>
custom_variables_value
<not_specific>
<not_specific>
:custom_variables_value custom_variables value
: custom_variables_value custom_variables value