mixpanel-ruby 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mixpanel-ruby/people.rb +4 -2
- data/lib/mixpanel-ruby/version.rb +1 -1
- data/spec/mixpanel-ruby/people_spec.rb +22 -0
- metadata +2 -2
data/lib/mixpanel-ruby/people.rb
CHANGED
@@ -218,11 +218,13 @@ module Mixpanel
|
|
218
218
|
end
|
219
219
|
|
220
220
|
# Permanently delete a profile from \Mixpanel people analytics
|
221
|
-
|
221
|
+
# To delete a user and ignore alias pass into optional params
|
222
|
+
# {"$ignore_alias"=>true}
|
223
|
+
def delete_user(distinct_id, optional_params={})
|
222
224
|
update({
|
223
225
|
'$distinct_id' => distinct_id,
|
224
226
|
'$delete' => ''
|
225
|
-
})
|
227
|
+
}.merge(optional_params))
|
226
228
|
end
|
227
229
|
|
228
230
|
# Send a generic update to \Mixpanel people analytics.
|
@@ -178,4 +178,26 @@ describe Mixpanel::People do
|
|
178
178
|
'$delete' => ''
|
179
179
|
}]])
|
180
180
|
end
|
181
|
+
|
182
|
+
it 'should send a well formed engage/delete message with blank optional_params' do
|
183
|
+
@people.delete_user("TEST ID", {})
|
184
|
+
expect(@log).to eq([[:profile_update, 'data' => {
|
185
|
+
'$token' => 'TEST TOKEN',
|
186
|
+
'$distinct_id' => 'TEST ID',
|
187
|
+
'$time' => @time_now.to_i * 1000,
|
188
|
+
'$delete' => ''
|
189
|
+
}]])
|
190
|
+
end
|
191
|
+
|
192
|
+
it 'should send a well formed engage/delete message with ignore_alias true' do
|
193
|
+
@people.delete_user("TEST ID", {"$ignore_alias"=>true})
|
194
|
+
expect(@log).to eq([[:profile_update, 'data' => {
|
195
|
+
'$token' => 'TEST TOKEN',
|
196
|
+
'$distinct_id' => 'TEST ID',
|
197
|
+
'$time' => @time_now.to_i * 1000,
|
198
|
+
'$delete' => '',
|
199
|
+
"$ignore_alias"=>true
|
200
|
+
}]])
|
201
|
+
end
|
202
|
+
|
181
203
|
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.
|
4
|
+
version: 1.6.0
|
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: 2014-
|
12
|
+
date: 2014-11-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|