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



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

Returns:

  • (Boolean)

Since:

  • 5.5.0



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

def initialized?
  true
end

#startObject

Since:

  • 5.5.0



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

#stopObject

Since:

  • 5.5.0



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

Since:

  • 5.5.0



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