Class: Microsandbox::SnapshotVerifyReport
- Inherits:
-
Object
- Object
- Microsandbox::SnapshotVerifyReport
- Defined in:
- lib/microsandbox/snapshot.rb
Overview
The result of Microsandbox::Snapshot.verify.
Instance Attribute Summary collapse
-
#algorithm ⇒ String?
readonly
Digest algorithm (when :verified).
-
#content_digest ⇒ String?
readonly
Matched content digest (when :verified).
-
#digest ⇒ String
readonly
Manifest digest.
-
#path ⇒ String
readonly
Artifact directory path.
-
#status ⇒ Symbol
readonly
:not_recorded or :verified.
Instance Method Summary collapse
-
#initialize(data) ⇒ SnapshotVerifyReport
constructor
A new instance of SnapshotVerifyReport.
-
#not_recorded? ⇒ Boolean
Whether no integrity descriptor was recorded.
-
#verified? ⇒ Boolean
Whether content integrity was recorded and matched.
Constructor Details
#initialize(data) ⇒ SnapshotVerifyReport
Returns a new instance of SnapshotVerifyReport.
63 64 65 66 67 68 69 |
# File 'lib/microsandbox/snapshot.rb', line 63 def initialize(data) @digest = data["digest"] @path = data["path"] @status = data["upper_status"].to_sym @algorithm = data["upper_algorithm"] @content_digest = data["upper_digest"] end |
Instance Attribute Details
#algorithm ⇒ String? (readonly)
Returns digest algorithm (when :verified).
59 60 61 |
# File 'lib/microsandbox/snapshot.rb', line 59 def algorithm @algorithm end |
#content_digest ⇒ String? (readonly)
Returns matched content digest (when :verified).
61 62 63 |
# File 'lib/microsandbox/snapshot.rb', line 61 def content_digest @content_digest end |
#digest ⇒ String (readonly)
Returns manifest digest.
53 54 55 |
# File 'lib/microsandbox/snapshot.rb', line 53 def digest @digest end |
#path ⇒ String (readonly)
Returns artifact directory path.
55 56 57 |
# File 'lib/microsandbox/snapshot.rb', line 55 def path @path end |
#status ⇒ Symbol (readonly)
Returns :not_recorded or :verified.
57 58 59 |
# File 'lib/microsandbox/snapshot.rb', line 57 def status @status end |
Instance Method Details
#not_recorded? ⇒ Boolean
Returns whether no integrity descriptor was recorded.
74 |
# File 'lib/microsandbox/snapshot.rb', line 74 def not_recorded? = @status == :not_recorded |
#verified? ⇒ Boolean
Returns whether content integrity was recorded and matched.
72 73 |
# File 'lib/microsandbox/snapshot.rb', line 72 def verified? = @status == :verified # @return [Boolean] whether no integrity descriptor was recorded |