class Kameleoon::Configuration::CustomDataInfo
def self.mapping_identifier?(custom_data_info, custom_data)
def self.mapping_identifier?(custom_data_info, custom_data) !custom_data_info.nil? && (custom_data.id == custom_data_info.mapping_identifier_index) && \ !(custom_data.values.empty? || custom_data.values[0].empty?) end
def initialize(hashes)
def initialize(hashes) @local_only = Set[] @visitor_scope = Set[] unless hashes.nil? for hash in hashes index = hash['index'] @local_only.add(index) if hash['localOnly'] @visitor_scope.add(index) if hash['scope'] == SCOPE_VISITOR if hash['isMappingIdentifier'] unless @mapping_identifier_index.nil? Logging::KameleoonLogger.warning('More than one mapping identifier is set. Undefined behavior ' \ 'may occur on cross-device reconciliation.') end @mapping_identifier_index = index end end end end
def local_only?(index)
def local_only?(index) @local_only.include?(index) end
def mapping_identifier?(index)
def mapping_identifier?(index) index == @mapping_identifier_index end
def visitor_scope?(index)
def visitor_scope?(index) @visitor_scope.include?(index) end