statsig 0.1.2 → 0.1.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/statsig_user.rb +13 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4fea4ebc3c58a51b2f2e9ccc9d0d85cb613ff24ac9ffa1f20033c1a8243a6a7
4
- data.tar.gz: cf87e74ffa0eaae65a9873dac7fcb7b4fdd054526fe160064edafcf6f5721ce7
3
+ metadata.gz: f41a1d20b9c249d023d561e447fc4f7dc746107e4215074596b405a3c22598bc
4
+ data.tar.gz: 3a285af817ab26710aff500afe493d7d79153d652fc62cb1c36b993e98812fb4
5
5
  SHA512:
6
- metadata.gz: 172dc804df678405ac485ffe1b3faba2555c341f3ea37c7ee2b024e1f19e1389c62e042b9763537e940a3876b8a8348f73ea7f6ca4bbb0cd2c4be2506ee2023e
7
- data.tar.gz: '092e5e9ba16538bd424c7dc44a9eea5f581ddb24c9813a4d29b73adadf5207f9ac789bce7c1855eea8e3967f1e01d11b5cbcd9fc9888b25418ce2b6caa2a262a'
6
+ metadata.gz: e29c7d17b69110935f96141a98faff6fa4644a795c4b7fd6600c04fe3835ad97cbf8928d1acc43742491d0c0c61d3247243c695cadbecf3ec618748377774b90
7
+ data.tar.gz: 0dc599774ade558878168fd121c3ceb4df2ca88e51b1bca16c2eb0fce52b8d1b0f23237215e49c92b11b6e07edd1a8d01788bbfe8e251c227fb4d59b35e59ebd
data/lib/statsig_user.rb CHANGED
@@ -15,6 +15,19 @@ class StatsigUser
15
15
  @custom = value.is_a?(Hash) ? value : Hash.new
16
16
  end
17
17
 
18
+ def initialize(user_hash = nil)
19
+ if user_hash.is_a?(Hash)
20
+ @user_id = user_hash['user_id']
21
+ @email = user_hash['email']
22
+ @ip = user_hash['ip']
23
+ @user_agent = user_hash['user_agent']
24
+ @country = user_hash['country']
25
+ @locale = user_hash['locale']
26
+ @client_version = user_hash['client_version']
27
+ @custom = user_hash['custom']
28
+ end
29
+ end
30
+
18
31
  def serialize
19
32
  {
20
33
  'userID' => @user_id,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statsig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Statsig, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-02 00:00:00.000000000 Z
11
+ date: 2021-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler