Class: LaunchDarkly::Impl::Integrations::TestData::TestDataSource
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::Integrations::TestData::TestDataSource
- Includes:
- LaunchDarkly::Interfaces::DataSource
- Defined in:
- lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb
Overview
Instance Method Summary collapse
-
#initialize(feature_store, test_data) ⇒ TestDataSource
constructor
A new instance of TestDataSource.
- #initialized? ⇒ Boolean
- #start ⇒ Object
- #stop ⇒ Object
- #upsert(kind, item) ⇒ Object
Constructor Details
#initialize(feature_store, test_data) ⇒ TestDataSource
Returns a new instance of TestDataSource.
12 13 14 15 |
# File 'lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb', line 12 def initialize(feature_store, test_data) @feature_store = feature_store @test_data = test_data end |
Instance Method Details
#initialized? ⇒ Boolean
17 18 19 |
# File 'lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb', line 17 def initialized? true end |
#start ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb', line 21 def start ready = Concurrent::Event.new ready.set init_data = @test_data.make_init_data @feature_store.init(init_data) ready end |
#stop ⇒ Object
29 30 31 |
# File 'lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb', line 29 def stop @test_data.closed_instance(self) end |
#upsert(kind, item) ⇒ Object
33 34 35 |
# File 'lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb', line 33 def upsert(kind, item) @feature_store.upsert(kind, item) end |