vwo-sdk 1.40.0 → 1.41.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 +4 -4
- data/lib/vwo/constants.rb +1 -1
- data/lib/vwo/enums.rb +8 -0
- data/lib/vwo/services/operand_evaluator.rb +37 -0
- data/lib/vwo/utils/segment.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b18f93260e450a83532607a0432354fcc931c6454bf830bf4a366091759f19cf
|
4
|
+
data.tar.gz: 93f40c73199b2dc5e3bd0c30afdac2c8873792aa28a58907244569b43bc10c8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6922959894100f9b3fcfcebe806ae9ab28953e5252af1e21e837339825fca0ae457b2d7cfe69e1d4ac885e3f8bca973b38d1c2ff0a3d47425168b3baf052701d
|
7
|
+
data.tar.gz: a3fe60c8cdb778c94d0168613281227e441543efbeb10cbbbec906022282c06b781fd089a1db50e90e802c054552df632c795899e5f59ef15f6129898171509a
|
data/lib/vwo/constants.rb
CHANGED
@@ -27,7 +27,7 @@ class VWO
|
|
27
27
|
HTTP_PROTOCOL = 'http://'
|
28
28
|
HTTPS_PROTOCOL = 'https://'
|
29
29
|
URL_NAMESPACE = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'
|
30
|
-
SDK_VERSION = '1.
|
30
|
+
SDK_VERSION = '1.41.0'
|
31
31
|
SDK_NAME = 'ruby'
|
32
32
|
VWO_DELIMITER = '_vwo_'
|
33
33
|
MAX_EVENTS_PER_REQUEST = 5000
|
data/lib/vwo/enums.rb
CHANGED
@@ -21,6 +21,10 @@ class VWO
|
|
21
21
|
WILDCARD = 'wildcard'
|
22
22
|
LOWER = 'lower'
|
23
23
|
EQUALS = 'equals'
|
24
|
+
GREATER_THAN="gt"
|
25
|
+
LESS_THAN="lt"
|
26
|
+
GREATER_THAN_EQUAL_TO="gte"
|
27
|
+
LESS_THAN_EQUAL_TO="lte"
|
24
28
|
end
|
25
29
|
|
26
30
|
module OperandValueTypes
|
@@ -30,6 +34,10 @@ class VWO
|
|
30
34
|
ENDS_WITH = 'ends_with'
|
31
35
|
REGEX = 'regex'
|
32
36
|
EQUALS = 'equals'
|
37
|
+
LESS_THAN = 'less_than'
|
38
|
+
GREATER_THAN = 'greater_than'
|
39
|
+
LESS_THAN_EQUAL_TO = 'less_than_equal_to'
|
40
|
+
GREATER_THAN_EQUAL_TO = 'greater_than_equal_to'
|
33
41
|
end
|
34
42
|
|
35
43
|
module OperatorTypes
|
@@ -83,6 +83,43 @@ class VWO
|
|
83
83
|
custom_variables_value == operand_value
|
84
84
|
end
|
85
85
|
|
86
|
+
# Checks if custom_variables_value matches the regex specified by operand_value
|
87
|
+
#
|
88
|
+
# @param [String] operand_value Leaf value from the segments
|
89
|
+
# @param [Numeric] custom_variables_value Value from the custom_variables
|
90
|
+
# @return [Boolean] True or False
|
91
|
+
def less_than?(operand_value, custom_variables_value)
|
92
|
+
custom_variables_value.to_f < operand_value.to_f
|
93
|
+
end
|
94
|
+
|
95
|
+
# Checks if custom_variable_value is greater than operand_value
|
96
|
+
#
|
97
|
+
# @param [String] operand_value Leaf value from the segments
|
98
|
+
# @param [Numeric] custom_variables_value Value from the custom_variables
|
99
|
+
# @return [Boolean] True or False
|
100
|
+
def greater_than?(operand_value, custom_variables_value)
|
101
|
+
custom_variables_value.to_f > operand_value.to_f
|
102
|
+
end
|
103
|
+
|
104
|
+
# Checks if custom_variable_value is less than or equal to operand_value
|
105
|
+
#
|
106
|
+
# @param [String] operand_value Leaf value from the segments
|
107
|
+
# @param [Numeric] custom_variables_value Value from the custom_variables
|
108
|
+
# @return [Boolean] True or False
|
109
|
+
def less_than_equal_to?(operand_value, custom_variables_value)
|
110
|
+
custom_variables_value.to_f <= operand_value.to_f
|
111
|
+
end
|
112
|
+
|
113
|
+
# Checks if custom_variable_value is greater than or equal to operand_value
|
114
|
+
#
|
115
|
+
# @param [String] operand_value Leaf value from the segments
|
116
|
+
# @param [Numeric] custom_variables_value Value from the custom_variables
|
117
|
+
# @return [Boolean] True or False
|
118
|
+
def greater_than_equal_to?(operand_value, custom_variables_value)
|
119
|
+
custom_variables_value.to_f >= operand_value.to_f
|
120
|
+
end
|
121
|
+
|
122
|
+
|
86
123
|
# Identifies the condition stated in the leaf node and evaluates the result
|
87
124
|
#
|
88
125
|
# @param [String] :operand_value Leaf value from the segments
|
data/lib/vwo/utils/segment.rb
CHANGED
@@ -101,6 +101,14 @@ class VWO
|
|
101
101
|
else
|
102
102
|
OperandValueTypes::EQUALS
|
103
103
|
end
|
104
|
+
elsif operand_type_name == OperandValueTypesName::GREATER_THAN
|
105
|
+
operand_type = OperandValueTypes::GREATER_THAN
|
106
|
+
elsif operand_type_name == OperandValueTypesName::LESS_THAN
|
107
|
+
operand_type = OperandValueTypes::LESS_THAN
|
108
|
+
elsif operand_type_name == OperandValueTypesName::GREATER_THAN_EQUAL_TO
|
109
|
+
operand_type = OperandValueTypes::GREATER_THAN_EQUAL_TO
|
110
|
+
elsif operand_type_name == OperandValueTypesName::LESS_THAN_EQUAL_TO
|
111
|
+
operand_type = OperandValueTypes::LESS_THAN_EQUAL_TO
|
104
112
|
end
|
105
113
|
|
106
114
|
# In case there is an abnormal patter, it would have passed all the above if cases, which means it
|
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.
|
4
|
+
version: 1.41.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VWO
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: codecov
|