leanplum_api 4.1.0 → 4.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 27ddea1f060526b4036a2a16b599545a7fc7e6da
4
- data.tar.gz: 36fbd9aa4ba81f37079bdfc0b53e67ca1793131e
3
+ metadata.gz: 6493c26fac538327d4f1d88ff0230622ece85a90
4
+ data.tar.gz: e2043f717baaa799397177f14da3f3caa47f49a8
5
5
  SHA512:
6
- metadata.gz: 6db5b8d90b017b3028ac90e890a062fd74f5961e81fca4466f6b6a99df3c4b6e4d74a122e90bf7258528f56fac7525634423a54400a433b063550f4d7faa3ae2
7
- data.tar.gz: da96de06564daca90953d5833e9605df430ac0e3c8464abed0dd5c26f92dc94dd9796e86c382f148839a0cdd1615a47b03e6ab891947df7a996d8716aa2adba0
6
+ metadata.gz: ebd25fd33f99964d306f3275cb8683d10a4695fd02fdc14ae2f4b7fd0054933102ad7d96aef4d1e09ca389feb4610b4f5315c184509cf0563aea59b4df78a6cb
7
+ data.tar.gz: 8975fad35cf5f915f4e05d2e4e6e2785617361eb7e1fa52f39af1dfb19cc9b37f7ba5fadbecdf089e67544ad2430bd7001ad6ce8a384287443d55bea3176d551
data/README.md CHANGED
@@ -102,6 +102,8 @@ api.set_user_attributes(user_attributes)
102
102
  event = {
103
103
  user_id: 12345,
104
104
  event: 'purchase',
105
+ currency_code: 'USD', # ISO 4217 currency code
106
+ value: 10.0,
105
107
  time: Time.now.utc, # Event timestamps will be converted to epoch seconds
106
108
  info: 'reallybigpurchase',
107
109
  some_event_property: 'boss_hog_on_candy'
@@ -175,6 +175,8 @@ module LeanplumApi
175
175
  event = { action: TRACK, event: event_name }.merge(extract_user_id_or_device_id_hash!(event_hash))
176
176
  event.merge!(time: event_hash.delete(:time).strftime('%s').to_i) if event_hash[:time]
177
177
  event.merge!(info: event_hash.delete(:info)) if event_hash[:info]
178
+ event.merge!(currencyCode: event_hash.delete(:currency_code)) if event_hash[:currency_code]
179
+ event.merge!(value: event_hash.delete(:value).to_f) if event_hash[:value]
178
180
  event.merge!(allowOffline: true) if options[:allow_offline]
179
181
 
180
182
  event_hash.keys.size > 0 ? event.merge(params: event_hash.symbolize_keys ) : event
@@ -1,3 +1,3 @@
1
1
  module LeanplumApi
2
- VERSION = '4.1.0'.freeze
2
+ VERSION = '4.2.1'.freeze
3
3
  end
@@ -180,13 +180,17 @@ describe LeanplumApi::API do
180
180
  context 'event tracking' do
181
181
  let(:timestamp) { '2015-05-01 01:02:03' }
182
182
  let(:purchase) { 'purchase' }
183
+ let(:currency_code) { 'USD' }
184
+ let(:purchase_value) { 10.0 }
183
185
  let(:events) do
184
186
  [
185
187
  {
186
188
  user_id: first_user_id,
187
189
  event: purchase,
188
190
  time: last_event_time,
189
- some_timestamp: timestamp
191
+ some_timestamp: timestamp,
192
+ currency_code: 'USD',
193
+ value: 10.0
190
194
  },
191
195
  {
192
196
  user_id: 54321,
@@ -201,6 +205,8 @@ describe LeanplumApi::API do
201
205
  {
202
206
  userId: first_user_id,
203
207
  event: purchase,
208
+ currencyCode: currency_code,
209
+ value: purchase_value,
204
210
  time: last_event_time.strftime('%s').to_i,
205
211
  action: described_class::TRACK,
206
212
  params: { some_timestamp: timestamp }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leanplum_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lumos Labs, Inc.
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-12-14 00:00:00.000000000 Z
12
+ date: 2018-02-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -111,28 +111,28 @@ dependencies:
111
111
  name: vcr
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - ">"
114
+ - - "~>"
115
115
  - !ruby/object:Gem::Version
116
116
  version: '2'
117
117
  type: :development
118
118
  prerelease: false
119
119
  version_requirements: !ruby/object:Gem::Requirement
120
120
  requirements:
121
- - - ">"
121
+ - - "~>"
122
122
  - !ruby/object:Gem::Version
123
123
  version: '2'
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: webmock
126
126
  requirement: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - ">"
128
+ - - "~>"
129
129
  - !ruby/object:Gem::Version
130
130
  version: '2'
131
131
  type: :development
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
134
134
  requirements:
135
- - - ">"
135
+ - - "~>"
136
136
  - !ruby/object:Gem::Version
137
137
  version: '2'
138
138
  - !ruby/object:Gem::Dependency
@@ -225,29 +225,29 @@ signing_key:
225
225
  specification_version: 4
226
226
  summary: Gem for the Leanplum API
227
227
  test_files:
228
+ - spec/spec_helper.rb
228
229
  - spec/api_spec.rb
229
230
  - spec/configuration_spec.rb
230
- - spec/data_export_api_spec.rb
231
- - spec/fixtures/vcr/delete_user.yml
232
- - spec/fixtures/vcr/export_data.yml
233
- - spec/fixtures/vcr/export_data_dates.yml
234
- - spec/fixtures/vcr/export_user.yml
231
+ - spec/fixtures/vcr/set_user_attributes_with_events.yml
232
+ - spec/fixtures/vcr/set_user_attributes.yml
233
+ - spec/fixtures/vcr/set_user_attributes_with_devices_and_events.yml
235
234
  - spec/fixtures/vcr/export_users.yml
236
- - spec/fixtures/vcr/get_ab_test.yml
237
- - spec/fixtures/vcr/get_ab_tests.yml
235
+ - spec/fixtures/vcr/track_events_anomaly_overrider.yml
236
+ - spec/fixtures/vcr/export_user.yml
238
237
  - spec/fixtures/vcr/get_export_results.yml
239
- - spec/fixtures/vcr/get_messages.yml
240
- - spec/fixtures/vcr/get_vars.yml
238
+ - spec/fixtures/vcr/track_events_and_attributes.yml
241
239
  - spec/fixtures/vcr/missing_message.yml
242
240
  - spec/fixtures/vcr/reset_anomalous_user.yml
243
- - spec/fixtures/vcr/set_device_attributes.yml
244
- - spec/fixtures/vcr/set_user_attributes.yml
241
+ - spec/fixtures/vcr/track_offline_events.yml
242
+ - spec/fixtures/vcr/get_vars.yml
243
+ - spec/fixtures/vcr/get_ab_test.yml
245
244
  - spec/fixtures/vcr/set_user_attributes_with_devices.yml
246
- - spec/fixtures/vcr/set_user_attributes_with_devices_and_events.yml
247
- - spec/fixtures/vcr/set_user_attributes_with_events.yml
245
+ - spec/fixtures/vcr/get_messages.yml
248
246
  - spec/fixtures/vcr/track_events.yml
249
- - spec/fixtures/vcr/track_events_and_attributes.yml
250
- - spec/fixtures/vcr/track_events_anomaly_overrider.yml
251
- - spec/fixtures/vcr/track_offline_events.yml
247
+ - spec/fixtures/vcr/set_device_attributes.yml
248
+ - spec/fixtures/vcr/export_data.yml
249
+ - spec/fixtures/vcr/delete_user.yml
250
+ - spec/fixtures/vcr/export_data_dates.yml
251
+ - spec/fixtures/vcr/get_ab_tests.yml
252
+ - spec/data_export_api_spec.rb
252
253
  - spec/http_spec.rb
253
- - spec/spec_helper.rb