Class: Dcc::Server::Storage::Entry

Inherits:
Struct
  • Object
show all
Defined in:
lib/dcc/server/storage/entry.rb

Overview

Value object for a stored DCC entry. Carries the SHA-256 id, XML payload, and expiry timestamp.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#expires_atObject

Returns the value of attribute expires_at

Returns:

  • (Object)

    the current value of expires_at



8
9
10
# File 'lib/dcc/server/storage/entry.rb', line 8

def expires_at
  @expires_at
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



8
9
10
# File 'lib/dcc/server/storage/entry.rb', line 8

def id
  @id
end

#xmlObject

Returns the value of attribute xml

Returns:

  • (Object)

    the current value of xml



8
9
10
# File 'lib/dcc/server/storage/entry.rb', line 8

def xml
  @xml
end

Instance Method Details

#expired?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/dcc/server/storage/entry.rb', line 9

def expired?
  expires_at && Time.now > expires_at
end