Class: LaunchDarkly::Impl::FeatureStoreClientWrapper
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::FeatureStoreClientWrapper
- 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.
Instance Method Summary collapse
- #all(kind) ⇒ Object
- #delete(kind, key, version) ⇒ Object
- #get(kind, key) ⇒ Object
- #init(all_data) ⇒ Object
-
#initialize(store) ⇒ FeatureStoreClientWrapper
constructor
A new instance of FeatureStoreClientWrapper.
- #initialized? ⇒ Boolean
- #stop ⇒ Object
- #upsert(kind, item) ⇒ Object
Constructor Details
#initialize(store) ⇒ FeatureStoreClientWrapper
Returns a new instance of FeatureStoreClientWrapper.
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
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
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
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
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
38 39 40 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 38 def initialized? @store.initialized? end |
#stop ⇒ Object
42 43 44 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 42 def stop @store.stop end |
#upsert(kind, item) ⇒ Object
30 31 32 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 30 def upsert(kind, item) @store.upsert(kind, item) end |