woopra_track 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5cd80a9b897128d3188fc214d56920b0f6f6e71a
4
- data.tar.gz: eb6b0184dd4c0f383473317738fe82cee005d0ce
3
+ metadata.gz: a6f8af52ee61a1780238ffeec9b7c40cae2665bd
4
+ data.tar.gz: d7edb8e3eae839dd050b21a906385feed6fe21a4
5
5
  SHA512:
6
- metadata.gz: e37c7cac2c3225ca71a0e1544477c1eef7bac2bdf961e4c7a09825d63284f4c076c8b4babc209ec8f9fe58b80978f6dc0e8c51ac37e6894586dc718567a20ed2
7
- data.tar.gz: c4c94bd8732f547324f213e0cdf382ccecfbb26d3c4ae9542ec074fc985ebe550ffb21d51c60038626ef1897805ad27b87a9f6efb268db132e21d8f312b057db
6
+ metadata.gz: 9aedd1e1a1f7349aec21833689971ea0f0878ffe6c05b2082264b86cd6eb608354747bcc570d2fa52007ab0c041971c6025294ce9556d8fe3747ab0c46ef2cd7
7
+ data.tar.gz: f1819d294c03fdf567667e869807330c10ec90090d17232da5ba6aaea259da530bd8d100614330e39251d4be683bdb71de98b2d94fa0a0fb469a8652337bc5cc
@@ -20,18 +20,18 @@ module WoopraTrack
20
20
  ignore_query_url: true,
21
21
  hide_campaign: false,
22
22
  ip_address: nil,
23
- cookie_value: nil,
24
- disable_tracking: false
23
+ cookie_value: nil
25
24
  }
26
25
 
27
26
  def initialize(request)
28
- @request = request
29
- @current_config = @@default_config
30
- @custom_config = { app: @@application_id }
31
- @user = {}
32
- @events = []
33
- @user_up_to_date = true
34
- @has_pushed = false
27
+ @request = request
28
+ @current_config = @@default_config
29
+ @custom_config = { app: @@application_id }
30
+ @user = {}
31
+ @events = []
32
+ @user_up_to_date = true
33
+ @has_pushed = false
34
+ @disable_tracking = false
35
35
 
36
36
  @current_config[:domain] = @request.host
37
37
  @current_config[:cookie_domain] = @request.host
@@ -44,10 +44,12 @@ module WoopraTrack
44
44
  end
45
45
 
46
46
  def config(data)
47
- data = Hash(data).select { |k, _v| k.in? @@default_config.keys }
48
- data = data.except(:ip_address, :cookie_value)
47
+ data = Hash(data)
48
+ custom = data.select { |k, _v| k.in? @@default_config.keys }
49
+ custom = custom.except(:ip_address, :cookie_value)
49
50
 
50
- @custom_config.merge!(data)
51
+ @custom_config = @custom_config.merge(custom)
52
+ @disable_tracking = data[:disable_tracking].is_a? TrueClass
51
53
  end
52
54
 
53
55
  def identify(user)
@@ -176,7 +178,7 @@ module WoopraTrack
176
178
  end
177
179
 
178
180
  def disable_tracking?
179
- @current_config[:disable_tracking].is_a? TrueClass
181
+ @disable_tracking.is_a? TrueClass
180
182
  end
181
183
  end
182
184
  end
@@ -1,3 +1,3 @@
1
1
  module WoopraTrack
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woopra_track
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonian Guveli