openfeature-sdk 0.3.0 → 0.3.1

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
  SHA256:
3
- metadata.gz: d79e98004b058036248ba05928ee5debe398a607a0d079f3d8d366fcde9bce07
4
- data.tar.gz: 76c896c762a1e5a7828f7785864c0bbb2034214c5ffcc12988af044ad23d2806
3
+ metadata.gz: '08a030402839c73a3704f262d09a72b284c96de65c7bdfb09b3020aa180b3448'
4
+ data.tar.gz: 4834664e0fced5480a5a36c3adad3ee64ab964ddd90de99fd4f477e168e78fe5
5
5
  SHA512:
6
- metadata.gz: 62d7a0aa1d5110d346afd5d39317064ef5f5722138bdd90cf31f96aa3587cd3fc1083cfade3b7d8f9b02560075078010e82104fcba9939621e301dfa12e3cf85
7
- data.tar.gz: 10540bcff19a5d57113d4b298f2f0ed9ddf13f3e1b2bdcff116ef27e6ac55c233a8b2ee4aba3468c40a31c698e9f3cbeb8208c2964f9df67551e632dd0190564
6
+ metadata.gz: 03d9d6b4fe3af45924f87a356e3f099789c44763a696e55132f31c263c6ef1fce00a4fdabb7b3224113e23f85d5fc00b43e2cebb8f8e05608e3decaedf39d29b
7
+ data.tar.gz: 9a27d780aec56d644bcda6232d91f03a9ff7022a973f8ef1adbd860a8f2e5d1ab0ab180760a6f30e4f5de22d059f1ef1fbf7473c6adafbc77a52385ea36e291e
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.3.0"
2
+ ".": "0.3.1"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.1](https://github.com/open-feature/ruby-sdk/compare/v0.3.0...v0.3.1) (2024-04-22)
4
+
5
+
6
+ ### Features
7
+
8
+ * add integer and float specific resolver methods ([#124](https://github.com/open-feature/ruby-sdk/issues/124)) ([eea9d17](https://github.com/open-feature/ruby-sdk/commit/eea9d17e5892064cec9d81bb0ef452e7e1761764))
9
+
3
10
  ## [0.3.0](https://github.com/open-feature/ruby-sdk/compare/v0.2.1...v0.3.0) (2024-04-05)
4
11
 
5
12
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openfeature-sdk (0.3.0)
4
+ openfeature-sdk (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -5,7 +5,7 @@ module OpenFeature
5
5
  # TODO: Write documentation
6
6
  #
7
7
  class Client
8
- RESULT_TYPE = %i[boolean string number object].freeze
8
+ RESULT_TYPE = %i[boolean string number integer float object].freeze
9
9
  SUFFIXES = %i[value details].freeze
10
10
 
11
11
  attr_reader :metadata, :evaluation_context
@@ -34,7 +34,15 @@ module OpenFeature
34
34
  end
35
35
 
36
36
  def fetch_number_value(flag_key:, default_value:, evaluation_context: nil)
37
- fetch_value(allowed_classes: [Integer, Float], flag_key:, default_value:, evaluation_context:)
37
+ fetch_value(allowed_classes: [Numeric], flag_key:, default_value:, evaluation_context:)
38
+ end
39
+
40
+ def fetch_integer_value(flag_key:, default_value:, evaluation_context: nil)
41
+ fetch_value(allowed_classes: [Integer], flag_key:, default_value:, evaluation_context:)
42
+ end
43
+
44
+ def fetch_float_value(flag_key:, default_value:, evaluation_context: nil)
45
+ fetch_value(allowed_classes: [Float], flag_key:, default_value:, evaluation_context:)
38
46
  end
39
47
 
40
48
  def fetch_object_value(flag_key:, default_value:, evaluation_context: nil)
@@ -52,7 +60,7 @@ module OpenFeature
52
60
  return ResolutionDetails.new(value: default_value, error_code: ErrorCode::FLAG_NOT_FOUND, reason: Reason::ERROR)
53
61
  end
54
62
 
55
- if allowed_classes.include?(value.class)
63
+ if allowed_classes.any? { |klass| value.is_a?(klass) }
56
64
  ResolutionDetails.new(value:, reason: Reason::STATIC)
57
65
  else
58
66
  ResolutionDetails.new(value: default_value, error_code: ErrorCode::TYPE_MISMATCH, reason: Reason::ERROR)
@@ -44,6 +44,14 @@ module OpenFeature
44
44
  no_op(default_value)
45
45
  end
46
46
 
47
+ def fetch_integer_value(flag_key:, default_value:, evaluation_context: nil)
48
+ no_op(default_value)
49
+ end
50
+
51
+ def fetch_float_value(flag_key:, default_value:, evaluation_context: nil)
52
+ no_op(default_value)
53
+ end
54
+
47
55
  def fetch_object_value(flag_key:, default_value:, evaluation_context: nil)
48
56
  no_op(default_value)
49
57
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OpenFeature
4
4
  module SDK
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openfeature-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenFeature Authors
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-05 00:00:00.000000000 Z
11
+ date: 2024-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug