splitclient-rb 1.0.3.wip1 → 1.0.3.wip2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2aa49b67939075427249268e6f0903caaf5b5805
4
- data.tar.gz: 3b8862a0b0bf6363efde70259c815ce36ea2bc2d
3
+ metadata.gz: 09f06b5c75b4912d46dd904c620aa3b9b60c4a05
4
+ data.tar.gz: 9069b9973cb86dbb33c66893d282d215beccb181
5
5
  SHA512:
6
- metadata.gz: a0354f6f0a535b14d5f03317d1aed86c94a922f8fd1e728dd2288bf606ee60de49fa7d63c2edef870f14871faba14d9365e0d73d6b1469b9ebcf081c07043082
7
- data.tar.gz: cc995eb2bc74c08ab11fe1280d07d2054013864bbe8af716fbac0af2aa99ef16dff2620e707e7ff642a91c1cec848280670c0e5c6f2bbbec73f88c79e4ffea3d
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')
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '1.0.3.wip1'
2
+ VERSION = '1.0.3.wip2'
3
3
  end
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.wip1
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-04-29 00:00:00.000000000 Z
11
+ date: 2016-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler