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 +4 -4
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/lib/open_feature/sdk/client.rb +1 -1
- data/lib/open_feature/sdk/provider/in_memory_provider.rb +10 -2
- data/lib/open_feature/sdk/provider/no_op_provider.rb +8 -0
- data/lib/open_feature/sdk/version.rb +1 -1
- 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: '08a030402839c73a3704f262d09a72b284c96de65c7bdfb09b3020aa180b3448'
|
4
|
+
data.tar.gz: 4834664e0fced5480a5a36c3adad3ee64ab964ddd90de99fd4f477e168e78fe5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03d9d6b4fe3af45924f87a356e3f099789c44763a696e55132f31c263c6ef1fce00a4fdabb7b3224113e23f85d5fc00b43e2cebb8f8e05608e3decaedf39d29b
|
7
|
+
data.tar.gz: 9a27d780aec56d644bcda6232d91f03a9ff7022a973f8ef1adbd860a8f2e5d1ab0ab180760a6f30e4f5de22d059f1ef1fbf7473c6adafbc77a52385ea36e291e
|
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
@@ -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: [
|
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.
|
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
|
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.
|
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-
|
11
|
+
date: 2024-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debug
|