statsig 1.20.0 → 1.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/statsig.rb +1 -1
- data/lib/statsig_user.rb +19 -11
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e976fe13de26ad1653e42b8a5a710210b51234cb96e6eaed6cbd350097f2370f
|
4
|
+
data.tar.gz: d0a3e427187fd4ae7cd0ff0b0c0e3c2bb88c3cf5dd7ed14a272f5dae89b18ea1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2eeaf918074df7b66ffd9746d7f1717efa1912be27e86698c44bd57869f2ca023590d5db9779bbf0b3312a26735781b51afc5fd7a5e726f13fc5af00f7395fec
|
7
|
+
data.tar.gz: '08d264d18cd2c772f05886782999e8c5703cf92d006a3395f57af84795b4cd309b8a7efe4d98b9e9d62378f584eb3735f3c299f859f0a46e660013e543780dca'
|
data/lib/statsig.rb
CHANGED
data/lib/statsig_user.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# typed: true
|
2
2
|
|
3
3
|
require 'sorbet-runtime'
|
4
|
+
require 'json'
|
4
5
|
|
5
6
|
##
|
6
7
|
# The user object to be evaluated against your Statsig configurations (gates/experiments/dynamic configs).
|
@@ -62,17 +63,24 @@ class StatsigUser
|
|
62
63
|
sig { params(user_hash: T.any(T::Hash[T.any(String, Symbol), T.untyped], NilClass)).void }
|
63
64
|
|
64
65
|
def initialize(user_hash)
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
@
|
73
|
-
@
|
74
|
-
@
|
75
|
-
@
|
66
|
+
the_hash = user_hash
|
67
|
+
begin
|
68
|
+
the_hash = JSON.parse(user_hash&.to_json || "")
|
69
|
+
rescue
|
70
|
+
puts 'Failed to clone user hash'
|
71
|
+
end
|
72
|
+
|
73
|
+
@user_id = from_hash(the_hash, [:user_id, :userID], String)
|
74
|
+
@email = from_hash(the_hash, [:email], String)
|
75
|
+
@ip = from_hash(the_hash, [:ip], String)
|
76
|
+
@user_agent = from_hash(the_hash, [:user_agent, :userAgent], String)
|
77
|
+
@country = from_hash(the_hash, [:country], String)
|
78
|
+
@locale = from_hash(the_hash, [:locale], String)
|
79
|
+
@app_version = from_hash(the_hash, [:app_version, :appVersion], String)
|
80
|
+
@custom = from_hash(the_hash, [:custom], Hash)
|
81
|
+
@private_attributes = from_hash(the_hash, [:private_attributes, :privateAttributes], Hash)
|
82
|
+
@custom_ids = from_hash(the_hash, [:custom_ids, :customIDs], Hash)
|
83
|
+
@statsig_environment = from_hash(the_hash, [:statsig_environment, :statsigEnvironment], Hash)
|
76
84
|
end
|
77
85
|
|
78
86
|
def serialize(for_logging)
|
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: 1.
|
4
|
+
version: 1.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Statsig, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -215,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
215
|
- !ruby/object:Gem::Version
|
216
216
|
version: '0'
|
217
217
|
requirements: []
|
218
|
-
rubygems_version: 3.
|
218
|
+
rubygems_version: 3.4.1
|
219
219
|
signing_key:
|
220
220
|
specification_version: 4
|
221
221
|
summary: Statsig server SDK for Ruby
|