Class: AbPanel::Javascript

Inherits:
Object
  • Object
show all
Defined in:
lib/ab_panel/javascript.rb

Class Method Summary collapse

Class Method Details

.environmentObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/ab_panel/javascript.rb', line 3

def self.environment
  props = { distinct_id: AbPanel.env["distinct_id"] }
  props.merge!(AbPanel.properties) if AbPanel.properties

  AbPanel.funnels.each { |f| props["funnel_#{f}"] = true }

  AbPanel.experiments.each { |exp| props[exp] = AbPanel.conditions.send(exp).condition }

  props.to_json
end