mixpanel-ruby 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,6 +38,10 @@ For more information please visit:
38
38
 
39
39
  == Changes
40
40
 
41
+ === 1.0.2
42
+ * Allow ip and optional_params arguments to be accepted by all
43
+ Mixpanel::People methods (except #destroy_user)
44
+
41
45
  === 1.0.1
42
46
  * Compatibility with earlier versions of ruby. Library development will continue
43
47
  to target 1.9, so later versions may not be compatible with Ruby 1.8, but we
@@ -116,8 +116,8 @@ module Mixpanel
116
116
  # tracker = Mixpanel::Tracker.new
117
117
  # tracker.people.plus_one("12345", "Albums Released")
118
118
  #
119
- def plus_one(distinct_id, property_name, ip=nil)
120
- increment(distinct_id, { property_name => 1 }, ip)
119
+ def plus_one(distinct_id, property_name, ip=nil, optional_params={})
120
+ increment(distinct_id, { property_name => 1 }, ip, optional_params)
121
121
  end
122
122
 
123
123
  # Appends a values to the end of list-valued properties.
@@ -174,11 +174,17 @@ module Mixpanel
174
174
  # tracker = Mixpanel::Tracker.new
175
175
  # tracker.people.unset("12345", "Overdue Since")
176
176
  #
177
- def unset(distinct_id, property)
178
- update({
177
+ def unset(distinct_id, property, ip=nil, optional_params={})
178
+ message = {
179
179
  '$distinct_id' => distinct_id,
180
180
  '$unset' => [ property ]
181
- })
181
+ }.merge(optional_params)
182
+
183
+ if ip
184
+ message['$ip'] = ip
185
+ end
186
+
187
+ update(message)
182
188
  end
183
189
 
184
190
  # Records a payment to you to a profile. Charges recorded with
@@ -201,8 +207,8 @@ module Mixpanel
201
207
  end
202
208
 
203
209
  # Clear all charges from a \Mixpanel people profile
204
- def clear_charges(distinct_id)
205
- unset(distinct_id, '$transactions')
210
+ def clear_charges(distinct_id, ip=nil, optional_params={})
211
+ unset(distinct_id, '$transactions', ip, optional_params)
206
212
  end
207
213
 
208
214
  # Permanently delete a profile from \Mixpanel people analytics
@@ -1,3 +1,3 @@
1
1
  module Mixpanel
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixpanel-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-12 00:00:00.000000000 Z
12
+ date: 2013-09-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake