Class: Rafflesia::CacheSweepRequest
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::CacheSweepRequest
- Defined in:
- lib/rafflesia/cache/cache_sweep_request.rb
Constant Summary collapse
- HASH_ATTRS =
{ apply: :apply, dry_run: :dry_run, max_bytes: :max_bytes, namespace: :namespace, older_than_seconds: :older_than_seconds, pinned_paths: :pinned_paths, policy: :policy, target_dir: :target_dir }.freeze
Instance Attribute Summary collapse
-
#apply ⇒ Object
Returns the value of attribute apply.
-
#dry_run ⇒ Object
Returns the value of attribute dry_run.
-
#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.
-
#policy ⇒ Object
Returns the value of attribute policy.
-
#target_dir ⇒ Object
Returns the value of attribute target_dir.
Instance Method Summary collapse
-
#initialize(json) ⇒ CacheSweepRequest
constructor
A new instance of CacheSweepRequest.
Constructor Details
#initialize(json) ⇒ CacheSweepRequest
Returns a new instance of CacheSweepRequest.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rafflesia/cache/cache_sweep_request.rb', line 29 def initialize(json) super() hash = self.class.normalize(json) @apply = hash[:apply] @dry_run = hash[:dry_run] @max_bytes = hash[:max_bytes] @namespace = hash[:namespace] @older_than_seconds = hash[:older_than_seconds] @pinned_paths = (hash[:pinned_paths] || []) @policy = hash[:policy] ? Rafflesia::CacheEvictionPolicy.new(hash[:policy]) : nil @target_dir = hash[:target_dir] end |
Instance Attribute Details
#apply ⇒ Object
Returns the value of attribute apply.
19 20 21 |
# File 'lib/rafflesia/cache/cache_sweep_request.rb', line 19 def apply @apply end |
#dry_run ⇒ Object
Returns the value of attribute dry_run.
19 20 21 |
# File 'lib/rafflesia/cache/cache_sweep_request.rb', line 19 def dry_run @dry_run end |
#max_bytes ⇒ Object
Returns the value of attribute max_bytes.
19 20 21 |
# File 'lib/rafflesia/cache/cache_sweep_request.rb', line 19 def max_bytes @max_bytes end |
#namespace ⇒ Object
Returns the value of attribute namespace.
19 20 21 |
# File 'lib/rafflesia/cache/cache_sweep_request.rb', line 19 def namespace @namespace end |
#older_than_seconds ⇒ Object
Returns the value of attribute older_than_seconds.
19 20 21 |
# File 'lib/rafflesia/cache/cache_sweep_request.rb', line 19 def older_than_seconds @older_than_seconds end |
#pinned_paths ⇒ Object
Returns the value of attribute pinned_paths.
19 20 21 |
# File 'lib/rafflesia/cache/cache_sweep_request.rb', line 19 def pinned_paths @pinned_paths end |
#policy ⇒ Object
Returns the value of attribute policy.
19 20 21 |
# File 'lib/rafflesia/cache/cache_sweep_request.rb', line 19 def policy @policy end |
#target_dir ⇒ Object
Returns the value of attribute target_dir.
19 20 21 |
# File 'lib/rafflesia/cache/cache_sweep_request.rb', line 19 def target_dir @target_dir end |