Class: Rafflesia::CacheStatusFile

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

Constant Summary collapse

HASH_ATTRS =
{
  is_eligible: :is_eligible,
  is_pinned: :is_pinned,
  mod_time_unix: :mod_time_unix,
  path: :path,
  rel_path: :rel_path,
  size_bytes: :size_bytes
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ CacheStatusFile

Returns a new instance of CacheStatusFile.



25
26
27
28
29
30
31
32
33
34
# File 'lib/rafflesia/cache/cache_status_file.rb', line 25

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @is_eligible = hash[:is_eligible]
  @is_pinned = hash[:is_pinned]
  @mod_time_unix = hash[:mod_time_unix]
  @path = hash[:path]
  @rel_path = hash[:rel_path]
  @size_bytes = hash[:size_bytes]
end

Instance Attribute Details

#is_eligibleObject

Returns the value of attribute is_eligible.



17
18
19
# File 'lib/rafflesia/cache/cache_status_file.rb', line 17

def is_eligible
  @is_eligible
end

#is_pinnedObject

Returns the value of attribute is_pinned.



17
18
19
# File 'lib/rafflesia/cache/cache_status_file.rb', line 17

def is_pinned
  @is_pinned
end

#mod_time_unixObject

Returns the value of attribute mod_time_unix.



17
18
19
# File 'lib/rafflesia/cache/cache_status_file.rb', line 17

def mod_time_unix
  @mod_time_unix
end

#pathObject

Returns the value of attribute path.



17
18
19
# File 'lib/rafflesia/cache/cache_status_file.rb', line 17

def path
  @path
end

#rel_pathObject

Returns the value of attribute rel_path.



17
18
19
# File 'lib/rafflesia/cache/cache_status_file.rb', line 17

def rel_path
  @rel_path
end

#size_bytesObject

Returns the value of attribute size_bytes.



17
18
19
# File 'lib/rafflesia/cache/cache_status_file.rb', line 17

def size_bytes
  @size_bytes
end