Class: Tebako::CacheCatalog::Entry

Inherits:
Struct
  • Object
show all
Defined in:
lib/tebako/cache_catalog.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#byte_sizeObject

Returns the value of attribute byte_size

Returns:

  • (Object)

    the current value of byte_size



20
21
22
# File 'lib/tebako/cache_catalog.rb', line 20

def byte_size
  @byte_size
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



20
21
22
# File 'lib/tebako/cache_catalog.rb', line 20

def key
  @key
end

#last_usedObject

Returns the value of attribute last_used

Returns:

  • (Object)

    the current value of last_used



20
21
22
# File 'lib/tebako/cache_catalog.rb', line 20

def last_used
  @last_used
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



20
21
22
# File 'lib/tebako/cache_catalog.rb', line 20

def path
  @path
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



20
21
22
# File 'lib/tebako/cache_catalog.rb', line 20

def type
  @type
end

#validObject

Returns the value of attribute valid

Returns:

  • (Object)

    the current value of valid



20
21
22
# File 'lib/tebako/cache_catalog.rb', line 20

def valid
  @valid
end

Instance Method Details

#to_hObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/tebako/cache_catalog.rb', line 21

def to_h
  {
    "type" => type,
    "key" => key,
    "path" => path,
    "size" => byte_size,
    "last_used" => last_used.utc.iso8601,
    "valid" => valid
  }
end