Class: Gitlab::Cache::Metadata
- Inherits:
-
Object
- Object
- Gitlab::Cache::Metadata
- Defined in:
- lib/gitlab/cache/metadata.rb
Overview
Value object for cache metadata
Constant Summary collapse
- VALID_BACKING_RESOURCES =
[:cpu, :database, :gitaly, :memory, :unknown].freeze
Instance Attribute Summary collapse
-
#backing_resource ⇒ Object
readonly
Returns the value of attribute backing_resource.
-
#cache_identifier ⇒ Object
readonly
Returns the value of attribute cache_identifier.
-
#feature_category ⇒ Object
readonly
Returns the value of attribute feature_category.
Instance Method Summary collapse
Constructor Details
#initialize(cache_identifier: nil, feature_category: Client::DEFAULT_FEATURE_CATEGORY, backing_resource: Client::DEFAULT_BACKING_RESOURCE) ⇒ Gitlab::Cache::Metadata
14 15 16 17 18 19 20 21 22 |
# File 'lib/gitlab/cache/metadata.rb', line 14 def initialize( cache_identifier: nil, feature_category: Client::DEFAULT_FEATURE_CATEGORY, backing_resource: Client::DEFAULT_BACKING_RESOURCE ) @cache_identifier = cache_identifier @feature_category = fetch_feature_category!(feature_category) @backing_resource = fetch_backing_resource!(backing_resource) end |
Instance Attribute Details
#backing_resource ⇒ Object (readonly)
Returns the value of attribute backing_resource.
24 25 26 |
# File 'lib/gitlab/cache/metadata.rb', line 24 def backing_resource @backing_resource end |
#cache_identifier ⇒ Object (readonly)
Returns the value of attribute cache_identifier.
24 25 26 |
# File 'lib/gitlab/cache/metadata.rb', line 24 def cache_identifier @cache_identifier end |
#feature_category ⇒ Object (readonly)
Returns the value of attribute feature_category.
24 25 26 |
# File 'lib/gitlab/cache/metadata.rb', line 24 def feature_category @feature_category end |