Class: LaunchDarkly::Impl::Integrations::TestData::TestDataSource

Inherits:
Object
  • Object
show all
Includes:
LaunchDarkly::Interfaces::DataSource
Defined in:
lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb

Overview

Since:

  • 5.5.0

Instance Method Summary collapse

Constructor Details

#initialize(feature_store, test_data) ⇒ TestDataSource

Returns a new instance of TestDataSource.

Since:

  • 5.5.0



11
12
13
14
# File 'lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb', line 11

def initialize(feature_store, test_data)
  @feature_store = feature_store
  @test_data = test_data
end

Instance Method Details

#initialized?Boolean

Returns:

  • (Boolean)

Since:

  • 5.5.0



16
17
18
# File 'lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb', line 16

def initialized?
  true
end

#startObject

Since:

  • 5.5.0



20
21
22
23
24
25
26
# File 'lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb', line 20

def start
  ready = Concurrent::Event.new
  ready.set
  init_data = @test_data.make_init_data
  @feature_store.init(init_data)
  ready
end

#stopObject

Since:

  • 5.5.0



28
29
30
# File 'lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb', line 28

def stop
  @test_data.closed_instance(self)
end

#upsert(kind, item) ⇒ Object

Since:

  • 5.5.0



32
33
34
# File 'lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb', line 32

def upsert(kind, item)
  @feature_store.upsert(kind, item)
end