Skip to content

Commit e8b0326

Browse files
authored
chore: Expose LDClient ahead of initial release (#9)
Exposing the backing LDClient is useful for customers who want to use OpenFeature where possible, but also want access to LaunchDarkly specific functionality (e.g. migrations).
1 parent 185c091 commit e8b0326

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/ldclient-openfeature/provider.rb

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ module OpenFeature
88
class Provider
99
attr_reader :metadata
1010

11+
#
12+
# @return client [LaunchDarkly::LDClient]
13+
#
14+
attr_reader :client
15+
1116
NUMERIC_TYPES = %i[integer float number].freeze
1217
private_constant :NUMERIC_TYPES
1318

spec/provider_spec.rb

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
expect(provider.metadata.name).to eq("launchdarkly-openfeature-server")
1515
end
1616

17+
it "exposes the underlying LaunchDarkly client" do
18+
expect(provider.client).to be_a LaunchDarkly::LDClient
19+
end
20+
1721
it "not providing context returns error" do
1822
resolution_details = provider.fetch_boolean_value(flag_key: "flag-key", default_value: true)
1923

0 commit comments

Comments
 (0)