Class: LaunchDarkly::Impl::FeatureStoreClientWrapper

Inherits:
Object
  • Object
show all
Includes:
LaunchDarkly::Interfaces::FeatureStore
Defined in:
lib/ldclient-rb/impl/store_client_wrapper.rb

Overview

Provides additional behavior that the client requires before or after feature store operations. Currently this just means sorting the data set for init(). In the future we may also use this to provide an update listener capability.

Since:

  • 5.5.0

Instance Method Summary collapse

Constructor Details

#initialize(store) ⇒ FeatureStoreClientWrapper

Returns a new instance of FeatureStoreClientWrapper.

Since:

  • 5.5.0



14
15
16
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 14

def initialize(store)
  @store = store
end

Instance Method Details

#all(kind) ⇒ Object

Since:

  • 5.5.0



26
27
28
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 26

def all(kind)
  @store.all(kind)
end

#delete(kind, key, version) ⇒ Object

Since:

  • 5.5.0



34
35
36
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 34

def delete(kind, key, version)
  @store.delete(kind, key, version)
end

#get(kind, key) ⇒ Object

Since:

  • 5.5.0



22
23
24
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 22

def get(kind, key)
  @store.get(kind, key)
end

#init(all_data) ⇒ Object

Since:

  • 5.5.0



18
19
20
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 18

def init(all_data)
  @store.init(FeatureStoreDataSetSorter.sort_all_collections(all_data))
end

#initialized?Boolean

Returns:

  • (Boolean)

Since:

  • 5.5.0



38
39
40
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 38

def initialized?
  @store.initialized?
end

#stopObject

Since:

  • 5.5.0



42
43
44
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 42

def stop
  @store.stop
end

#upsert(kind, item) ⇒ Object

Since:

  • 5.5.0



30
31
32
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 30

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