splitclient-rb 1.0.3.wip1 → 1.0.3.wip2
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/splitclient-engine/matchers/between_matcher.rb +4 -3
- data/lib/splitclient-engine/matchers/equal_to_matcher.rb +3 -2
- data/lib/splitclient-engine/matchers/greater_than_or_equal_to_matcher.rb +3 -2
- data/lib/splitclient-engine/matchers/less_than_or_equal_to_matcher.rb +3 -2
- data/lib/splitclient-rb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09f06b5c75b4912d46dd904c620aa3b9b60c4a05
|
4
|
+
data.tar.gz: 9069b9973cb86dbb33c66893d282d215beccb181
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3dd77e39303b719bb74519510fdab3422cac56b8d30e369f32367b009dcf8bfc39200d8859971ebb73eafcfeca3093b5198c70c385262b3853dd5e8b067d23b
|
7
|
+
data.tar.gz: 5e982de5c0eddec40fd56071b3bcfb5855dc65b6742583286777cea55cbb5227584d687de9fc847a8866759bd50a922511188885f9f07491f5d5368983bd13d9
|
@@ -7,9 +7,9 @@ module SplitIoClient
|
|
7
7
|
def initialize(attribute_hash)
|
8
8
|
@matcher_type = "BETWEEN"
|
9
9
|
@attribute = attribute_hash[:attribute]
|
10
|
-
@start_value = attribute_hash[:start_value]
|
11
|
-
@end_value = attribute_hash[:end_value]
|
12
10
|
@data_type = attribute_hash[:data_type]
|
11
|
+
@start_value = get_formatted_value attribute_hash[:start_value], true
|
12
|
+
@end_value = get_formatted_value attribute_hash[:end_value], true
|
13
13
|
end
|
14
14
|
|
15
15
|
def match?(attributes)
|
@@ -33,11 +33,12 @@ module SplitIoClient
|
|
33
33
|
end
|
34
34
|
|
35
35
|
private
|
36
|
-
def get_formatted_value(value)
|
36
|
+
def get_formatted_value(value, is_sdk_data = false)
|
37
37
|
case @data_type
|
38
38
|
when "NUMBER"
|
39
39
|
return value
|
40
40
|
when "DATETIME"
|
41
|
+
value = value/1000 if is_sdk_data
|
41
42
|
return ::Utilities.to_milis_zero_out_from_seconds value
|
42
43
|
else
|
43
44
|
@logger.error('Invalid data type')
|
@@ -7,8 +7,8 @@ module SplitIoClient
|
|
7
7
|
def initialize(attribute_hash)
|
8
8
|
@matcher_type = "EQUAL_TO"
|
9
9
|
@attribute = attribute_hash[:attribute]
|
10
|
-
@value = attribute_hash[:value]
|
11
10
|
@data_type = attribute_hash[:data_type]
|
11
|
+
@value = get_formatted_value attribute_hash[:value], true
|
12
12
|
end
|
13
13
|
|
14
14
|
def match?(attributes)
|
@@ -32,11 +32,12 @@ module SplitIoClient
|
|
32
32
|
end
|
33
33
|
|
34
34
|
private
|
35
|
-
def get_formatted_value(value)
|
35
|
+
def get_formatted_value(value, is_sdk_data = false)
|
36
36
|
case @data_type
|
37
37
|
when "NUMBER"
|
38
38
|
return value
|
39
39
|
when "DATETIME"
|
40
|
+
value = value/1000 if is_sdk_data
|
40
41
|
return ::Utilities.to_milis_zero_out_from_hour value
|
41
42
|
else
|
42
43
|
@logger.error('Invalid data type')
|
@@ -7,8 +7,8 @@ module SplitIoClient
|
|
7
7
|
def initialize(attribute_hash)
|
8
8
|
@matcher_type = "GREATER_THAN_OR_EQUAL_TO"
|
9
9
|
@attribute = attribute_hash[:attribute]
|
10
|
-
@value = attribute_hash[:value]
|
11
10
|
@data_type = attribute_hash[:data_type]
|
11
|
+
@value = get_formatted_value attribute_hash[:value], true
|
12
12
|
end
|
13
13
|
|
14
14
|
def match?(attributes)
|
@@ -32,11 +32,12 @@ module SplitIoClient
|
|
32
32
|
end
|
33
33
|
|
34
34
|
private
|
35
|
-
def get_formatted_value(value)
|
35
|
+
def get_formatted_value(value, is_sdk_data = false)
|
36
36
|
case @data_type
|
37
37
|
when "NUMBER"
|
38
38
|
return value
|
39
39
|
when "DATETIME"
|
40
|
+
value = value/1000 if is_sdk_data # sdk returns already miliseconds, turning to seconds to do a correct zero_our
|
40
41
|
return ::Utilities.to_milis_zero_out_from_seconds value
|
41
42
|
else
|
42
43
|
@logger.error('Invalid data type')
|
@@ -7,8 +7,8 @@ module SplitIoClient
|
|
7
7
|
def initialize(attribute_hash)
|
8
8
|
@matcher_type = "LESS_THAN_OR_EQUAL_TO"
|
9
9
|
@attribute = attribute_hash[:attribute]
|
10
|
-
@value = attribute_hash[:value]
|
11
10
|
@data_type = attribute_hash[:data_type]
|
11
|
+
@value = get_formatted_value attribute_hash[:value], true
|
12
12
|
end
|
13
13
|
|
14
14
|
def match?(attributes)
|
@@ -32,11 +32,12 @@ module SplitIoClient
|
|
32
32
|
end
|
33
33
|
|
34
34
|
private
|
35
|
-
def get_formatted_value(value)
|
35
|
+
def get_formatted_value(value, is_sdk_data = false)
|
36
36
|
case @data_type
|
37
37
|
when "NUMBER"
|
38
38
|
return value
|
39
39
|
when "DATETIME"
|
40
|
+
value = value/1000 if is_sdk_data # sdk returns already miliseconds, turning to seconds to do a correct zero_our
|
40
41
|
return ::Utilities.to_milis_zero_out_from_seconds value
|
41
42
|
else
|
42
43
|
@logger.error('Invalid data type')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: splitclient-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.3.
|
4
|
+
version: 1.0.3.wip2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Split Software
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|