vwo-sdk 1.15.0 → 1.16.0

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
  SHA256:
3
- metadata.gz: 2307340499cf5f0fd3fd13ab5025fc4892721123c82bc3df8eff266362d01c82
4
- data.tar.gz: a0a3343ef9af102444cd9a6dd590937d5c737a3ed46765d3bd9cb8e18ceb41bf
3
+ metadata.gz: '084660e0c3fcb3c07826944ba8d83988711b59165ea54a54b1e47042a889bbf5'
4
+ data.tar.gz: 62c4ae889870a381d2973967412f0916baa0d25ce377604aa096c5f4dd0a8e79
5
5
  SHA512:
6
- metadata.gz: f1c28b3c5b86fa2b4488b5995a9931aaea708d1788f803c079f2fc5684fca81d82465f798e9653d227d448d6c08688791cf0740f774526ed38bd345e252b91fa
7
- data.tar.gz: e4d2fcfca37407b7ed7ff008bc2d2d6b03e7f6bddd2f653825fd059306de36254ee4d46165e0973524e701d62e9a972c11a586089c5279027fb4ea5dc589060f
6
+ metadata.gz: 67fd788b416ac54e9d27999ca757662eb88a123a804ccf3c93538e58787a3fd1181686543a7abdbb94dbd7d66f5d1c63421ae21d1b3e794b93cff6951355fdd2
7
+ data.tar.gz: 7950a38da6e5993575ff46e1c1ba2f901d98fa4112e54070297c78846e2b29eacdae4042c51d03f1e9e8b05d55aa4e60b698fa70af43c7d1ae2167953aaaec6c
data/lib/vwo/constants.rb CHANGED
@@ -26,7 +26,7 @@ class VWO
26
26
  HTTP_PROTOCOL = 'http://'
27
27
  HTTPS_PROTOCOL = 'https://'
28
28
  URL_NAMESPACE = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'
29
- SDK_VERSION = '1.15.0'
29
+ SDK_VERSION = '1.16.0'
30
30
  SDK_NAME = 'ruby'
31
31
  VWO_DELIMITER = '_vwo_'
32
32
  MAX_EVENTS_PER_REQUEST = 5000
@@ -68,6 +68,7 @@ class VWO
68
68
  INTEGER = 'integer'
69
69
  DOUBLE = 'double'
70
70
  BOOLEAN = 'boolean'
71
+ JSON = 'json'
71
72
  end
72
73
 
73
74
  module Hooks
@@ -80,7 +81,8 @@ class VWO
80
81
  'string' => [String],
81
82
  'integer' => [Integer],
82
83
  'double' => [Float],
83
- 'boolean' => [TrueClass, FalseClass]
84
+ 'boolean' => [TrueClass, FalseClass],
85
+ 'json' => [Hash]
84
86
  }
85
87
 
86
88
  GOAL_TYPES = {
@@ -54,7 +54,13 @@ class VWO
54
54
  },
55
55
  weight: {
56
56
  type: %w[number string]
57
- }
57
+ },
58
+ variables: {
59
+ type: 'array',
60
+ items: {
61
+ '$ref' => '#/definitions/variables_schema'
62
+ }
63
+ }
58
64
  },
59
65
  required: %w[id name weight]
60
66
  },
@@ -79,9 +85,33 @@ class VWO
79
85
  '$ref' => '#/definitions/campaign_variation_schema'
80
86
  }
81
87
  },
88
+ variables: {
89
+ type: 'array',
90
+ items: {
91
+ '$ref' => '#/definitions/variables_schema'
92
+ }
93
+ },
82
94
  minItems: 2
83
95
  }
84
96
  },
97
+ variables_schema: {
98
+ type: 'object',
99
+ properties: {
100
+ id: {
101
+ type: %w[number string]
102
+ },
103
+ key: {
104
+ type: ['string']
105
+ },
106
+ type: {
107
+ type: ['string']
108
+ },
109
+ value: {
110
+ type: %w[number string boolean double object]
111
+ }
112
+ },
113
+ required: %w[id key type value]
114
+ },
85
115
  required: %w[
86
116
  id
87
117
  key
@@ -38,6 +38,8 @@ class VWO
38
38
  return value.to_f if variable_type == VariableTypes::DOUBLE
39
39
 
40
40
  return !value || value == 0 ? false : true if variable_type == VariableTypes.BOOLEAN
41
+
42
+ return value if variable_type == VariableTypes::JSON
41
43
  rescue StandardError => _e
42
44
  VWO::Logger.get_instance.log(
43
45
  LogLevelEnum::ERROR,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vwo-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.0
4
+ version: 1.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - VWO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-23 00:00:00.000000000 Z
11
+ date: 2021-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: codecov