Class: GosquaredRails::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.


6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/configuration.rb', line 6

def initialize
  @site_token = nil
  @track_local = nil
  @anonymize_ip = nil
  @cookie_domain = nil
  @use_cookies = nil
  @referrer = nil
  @track_hash = nil
  @track_params = nil
  @identified_user = nil
  @custom_properties = nil
end

Instance Attribute Details

#anonymize_ipObject

Returns the value of attribute anonymize_ip


3
4
5
# File 'lib/configuration.rb', line 3

def anonymize_ip
  @anonymize_ip
end

Returns the value of attribute cookie_domain


3
4
5
# File 'lib/configuration.rb', line 3

def cookie_domain
  @cookie_domain
end

#custom_propertiesObject

Returns the value of attribute custom_properties


3
4
5
# File 'lib/configuration.rb', line 3

def custom_properties
  @custom_properties
end

#identified_userObject

Returns the value of attribute identified_user


3
4
5
# File 'lib/configuration.rb', line 3

def identified_user
  @identified_user
end

#referrerObject

Returns the value of attribute referrer


3
4
5
# File 'lib/configuration.rb', line 3

def referrer
  @referrer
end

#site_tokenObject

Returns the value of attribute site_token


3
4
5
# File 'lib/configuration.rb', line 3

def site_token
  @site_token
end

#track_hashObject

Returns the value of attribute track_hash


3
4
5
# File 'lib/configuration.rb', line 3

def track_hash
  @track_hash
end

#track_localObject

Returns the value of attribute track_local


3
4
5
# File 'lib/configuration.rb', line 3

def track_local
  @track_local
end

#track_paramsObject

Returns the value of attribute track_params


3
4
5
# File 'lib/configuration.rb', line 3

def track_params
  @track_params
end

#use_cookiesObject

Returns the value of attribute use_cookies


3
4
5
# File 'lib/configuration.rb', line 3

def use_cookies
  @use_cookies
end

Instance Method Details

#config_optionsObject


19
20
21
22
23
24
25
26
27
# File 'lib/configuration.rb', line 19

def config_options
@configurations = [set_track_local, set_anonymize_ip,
  set_cookie_domain, set_use_cookies, set_referrer, set_track_hash, set_track_params]
  @display_config = []
  @configurations.each do |config|
    @display_config << config if config
  end
  @display_config.join(" ")
end

#set_anonymize_ipObject


33
34
35
# File 'lib/configuration.rb', line 33

def set_anonymize_ip
  "_gs('set', 'anonymizeIP', true);" if @anonymize_ip == true
end

37
38
39
# File 'lib/configuration.rb', line 37

def set_cookie_domain
  "_gs('set', 'cookieDomain', '#{@cookie_domain}');" if @cookie_domain
end

#set_referrerObject


45
46
47
# File 'lib/configuration.rb', line 45

def set_referrer
  "_gs('set', 'referrer', '#{@referrer}');" if @referrer
end

#set_track_hashObject


49
50
51
# File 'lib/configuration.rb', line 49

def set_track_hash
  "_gs('set', 'trackHash', true);" if @track_hash == true
end

#set_track_localObject


29
30
31
# File 'lib/configuration.rb', line 29

def set_track_local
  "_gs('set', 'trackLocal', true);" if track_local == true
end

#set_track_paramsObject


53
54
55
# File 'lib/configuration.rb', line 53

def set_track_params
  "_gs('set', 'trackParams', false);" if @track_params == false
end

#set_use_cookiesObject


41
42
43
# File 'lib/configuration.rb', line 41

def set_use_cookies
  "_gs('set', 'useCookies', false);" if @use_cookies == false
end