Class: Sigstore::TUF::Targets::Target
- Inherits:
-
Object
- Object
- Sigstore::TUF::Targets::Target
- Includes:
- BaseFile
- Defined in:
- lib/sigstore/tuf/targets.rb
Instance Attribute Summary collapse
-
#hashes ⇒ Object
readonly
Returns the value of attribute hashes.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(data, path) ⇒ Target
constructor
A new instance of Target.
- #verify_length_and_hashes(data) ⇒ Object
Methods included from BaseFile
Constructor Details
#initialize(data, path) ⇒ Target
53 54 55 56 57 |
# File 'lib/sigstore/tuf/targets.rb', line 53 def initialize(data, path) @path = path @length = data.fetch("length") @hashes = data.fetch("hashes") end |
Instance Attribute Details
#hashes ⇒ Object (readonly)
Returns the value of attribute hashes.
49 50 51 |
# File 'lib/sigstore/tuf/targets.rb', line 49 def hashes @hashes end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
49 50 51 |
# File 'lib/sigstore/tuf/targets.rb', line 49 def path @path end |
Instance Method Details
#verify_length_and_hashes(data) ⇒ Object
59 60 61 62 |
# File 'lib/sigstore/tuf/targets.rb', line 59 def verify_length_and_hashes(data) self.class.verify_length(data, @length) self.class.verify_hashes(data, @hashes) end |