Class: Rafflesia::CacheEvictionPolicy
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::CacheEvictionPolicy
- Defined in:
- lib/rafflesia/cache/cache_eviction_policy.rb
Constant Summary collapse
- HASH_ATTRS =
{ max_age_seconds: :max_age_seconds, max_bytes: :max_bytes, namespace: :namespace, older_than_seconds: :older_than_seconds, pinned_paths: :pinned_paths, pinned_shards: :pinned_shards }.freeze
Instance Attribute Summary collapse
-
#max_age_seconds ⇒ Object
Returns the value of attribute max_age_seconds.
-
#max_bytes ⇒ Object
Returns the value of attribute max_bytes.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#older_than_seconds ⇒ Object
Returns the value of attribute older_than_seconds.
-
#pinned_paths ⇒ Object
Returns the value of attribute pinned_paths.
-
#pinned_shards ⇒ Object
Returns the value of attribute pinned_shards.
Instance Method Summary collapse
-
#initialize(json) ⇒ CacheEvictionPolicy
constructor
A new instance of CacheEvictionPolicy.
Constructor Details
#initialize(json) ⇒ CacheEvictionPolicy
Returns a new instance of CacheEvictionPolicy.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rafflesia/cache/cache_eviction_policy.rb', line 25 def initialize(json) super() hash = self.class.normalize(json) @max_age_seconds = hash[:max_age_seconds] @max_bytes = hash[:max_bytes] @namespace = hash[:namespace] @older_than_seconds = hash[:older_than_seconds] @pinned_paths = (hash[:pinned_paths] || []) @pinned_shards = (hash[:pinned_shards] || []) end |
Instance Attribute Details
#max_age_seconds ⇒ Object
Returns the value of attribute max_age_seconds.
17 18 19 |
# File 'lib/rafflesia/cache/cache_eviction_policy.rb', line 17 def max_age_seconds @max_age_seconds end |
#max_bytes ⇒ Object
Returns the value of attribute max_bytes.
17 18 19 |
# File 'lib/rafflesia/cache/cache_eviction_policy.rb', line 17 def max_bytes @max_bytes end |
#namespace ⇒ Object
Returns the value of attribute namespace.
17 18 19 |
# File 'lib/rafflesia/cache/cache_eviction_policy.rb', line 17 def namespace @namespace end |
#older_than_seconds ⇒ Object
Returns the value of attribute older_than_seconds.
17 18 19 |
# File 'lib/rafflesia/cache/cache_eviction_policy.rb', line 17 def older_than_seconds @older_than_seconds end |
#pinned_paths ⇒ Object
Returns the value of attribute pinned_paths.
17 18 19 |
# File 'lib/rafflesia/cache/cache_eviction_policy.rb', line 17 def pinned_paths @pinned_paths end |
#pinned_shards ⇒ Object
Returns the value of attribute pinned_shards.
17 18 19 |
# File 'lib/rafflesia/cache/cache_eviction_policy.rb', line 17 def pinned_shards @pinned_shards end |