Class: Caboose::RetargetingConfig

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/caboose/retargeting_config.rb

Instance Method Summary collapse

Instance Method Details

#fb_vars(request, page) ⇒ Object



24
25
26
27
28
29
30
# File 'app/models/caboose/retargeting_config.rb', line 24

def fb_vars(request, page)
  return [] if self.fb_vars_function.nil? || self.fb_vars_function.strip.length == 0      
  arr = eval(self.fb_vars_function)      
  return [] if arr.nil?
  return [arr] if arr is_a? String
  return arr        
end

#google_labels(request, page) ⇒ Object

:fb_access_token, :fb_access_token_expires



15
16
17
18
19
20
21
22
# File 'app/models/caboose/retargeting_config.rb', line 15

def google_labels(request, page)
  return [] if self.google_labels_function.nil? || self.google_labels_function.strip.length == 0      
  return [self.google_labels_function] if self.google_labels_function.starts_with?('_')        
  arr = eval(self.google_labels_function)      
  return [] if arr.nil?
  return [arr] if arr is_a? String
  return arr        
end