Class: LaunchDarkly::Impl::DataStore::DataKind Private
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::DataStore::DataKind
- Defined in:
- lib/ldclient-rb/impl/data_store/data_kind.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- FEATURES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"features".freeze
- SEGMENTS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"segments".freeze
- FEATURE_PREREQ_FN =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
lambda { |flag| (flag[:prerequisites] || []).map { |p| p[:key] } }.freeze
Instance Attribute Summary collapse
- #namespace ⇒ Object readonly private
- #priority ⇒ Object readonly private
Instance Method Summary collapse
-
#[](key) ⇒ Object
private
Maintain the same behavior when these data kinds were standard ruby hashes.
- #eql?(other) ⇒ Boolean private
-
#get_dependency_keys_fn ⇒ Object
private
Retrieve the dependency keys for a particular data kind.
- #hash ⇒ Object private
-
#initialize(namespace:, priority:) ⇒ DataKind
constructor
private
A new instance of DataKind.
Constructor Details
#initialize(namespace:, priority:) ⇒ DataKind
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of DataKind.
20 21 22 23 |
# File 'lib/ldclient-rb/impl/data_store/data_kind.rb', line 20 def initialize(namespace:, priority:) @namespace = namespace @priority = priority end |
Instance Attribute Details
#namespace ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 |
# File 'lib/ldclient-rb/impl/data_store/data_kind.rb', line 13 def namespace @namespace end |
#priority ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 |
# File 'lib/ldclient-rb/impl/data_store/data_kind.rb', line 14 def priority @priority end |
Instance Method Details
#[](key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Maintain the same behavior when these data kinds were standard ruby hashes.
31 32 33 34 35 36 |
# File 'lib/ldclient-rb/impl/data_store/data_kind.rb', line 31 def [](key) return priority if key == :priority return namespace if key == :namespace return get_dependency_keys_fn() if key == :get_dependency_keys nil end |
#eql?(other) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 |
# File 'lib/ldclient-rb/impl/data_store/data_kind.rb', line 47 def eql?(other) other.is_a?(DataKind) && namespace == other.namespace && priority == other.priority end |
#get_dependency_keys_fn ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Retrieve the dependency keys for a particular data kind. Right now, this is only defined for flags.
41 42 43 44 45 |
# File 'lib/ldclient-rb/impl/data_store/data_kind.rb', line 41 def get_dependency_keys_fn() return nil unless @namespace == FEATURES FEATURE_PREREQ_FN end |
#hash ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
51 52 53 |
# File 'lib/ldclient-rb/impl/data_store/data_kind.rb', line 51 def hash [namespace, priority].hash end |