Class: Rafflesia::CacheNamespaceUsage

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/cache/cache_namespace_usage.rb

Constant Summary collapse

HASH_ATTRS =
{
  active_lease_count: :active_lease_count,
  active_lease_pinned_count: :active_lease_pinned_count,
  eligible_size_bytes: :eligible_size_bytes,
  file_count: :file_count,
  namespace: :namespace,
  pinned_size_bytes: :pinned_size_bytes,
  target_dir: :target_dir,
  total_size_bytes: :total_size_bytes
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ CacheNamespaceUsage

Returns a new instance of CacheNamespaceUsage.



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rafflesia/cache/cache_namespace_usage.rb', line 29

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @active_lease_count = hash[:active_lease_count]
  @active_lease_pinned_count = hash[:active_lease_pinned_count]
  @eligible_size_bytes = hash[:eligible_size_bytes]
  @file_count = hash[:file_count]
  @namespace = hash[:namespace]
  @pinned_size_bytes = hash[:pinned_size_bytes]
  @target_dir = hash[:target_dir]
  @total_size_bytes = hash[:total_size_bytes]
end

Instance Attribute Details

#active_lease_countObject

Returns the value of attribute active_lease_count.



19
20
21
# File 'lib/rafflesia/cache/cache_namespace_usage.rb', line 19

def active_lease_count
  @active_lease_count
end

#active_lease_pinned_countObject

Returns the value of attribute active_lease_pinned_count.



19
20
21
# File 'lib/rafflesia/cache/cache_namespace_usage.rb', line 19

def active_lease_pinned_count
  @active_lease_pinned_count
end

#eligible_size_bytesObject

Returns the value of attribute eligible_size_bytes.



19
20
21
# File 'lib/rafflesia/cache/cache_namespace_usage.rb', line 19

def eligible_size_bytes
  @eligible_size_bytes
end

#file_countObject

Returns the value of attribute file_count.



19
20
21
# File 'lib/rafflesia/cache/cache_namespace_usage.rb', line 19

def file_count
  @file_count
end

#namespaceObject

Returns the value of attribute namespace.



19
20
21
# File 'lib/rafflesia/cache/cache_namespace_usage.rb', line 19

def namespace
  @namespace
end

#pinned_size_bytesObject

Returns the value of attribute pinned_size_bytes.



19
20
21
# File 'lib/rafflesia/cache/cache_namespace_usage.rb', line 19

def pinned_size_bytes
  @pinned_size_bytes
end

#target_dirObject

Returns the value of attribute target_dir.



19
20
21
# File 'lib/rafflesia/cache/cache_namespace_usage.rb', line 19

def target_dir
  @target_dir
end

#total_size_bytesObject

Returns the value of attribute total_size_bytes.



19
20
21
# File 'lib/rafflesia/cache/cache_namespace_usage.rb', line 19

def total_size_bytes
  @total_size_bytes
end