Class: Microsandbox::SnapshotVerifyReport

Inherits:
Object
  • Object
show all
Defined in:
lib/microsandbox/snapshot.rb

Overview

The result of Microsandbox::Snapshot.verify. Schema-1 descriptors always record integrity, so a returned report is always :verified — an integrity mismatch raises SnapshotIntegrityError instead of returning.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ SnapshotVerifyReport

Returns a new instance of SnapshotVerifyReport.



133
134
135
136
137
138
139
# File 'lib/microsandbox/snapshot.rb', line 133

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

#algorithmString (readonly)

Returns digest algorithm.

Returns:

  • (String)

    digest algorithm



129
130
131
# File 'lib/microsandbox/snapshot.rb', line 129

def algorithm
  @algorithm
end

#content_digestString (readonly)

Returns matched content digest.

Returns:

  • (String)

    matched content digest



131
132
133
# File 'lib/microsandbox/snapshot.rb', line 131

def content_digest
  @content_digest
end

#digestString (readonly)

Returns descriptor digest.

Returns:

  • (String)

    descriptor digest



123
124
125
# File 'lib/microsandbox/snapshot.rb', line 123

def digest
  @digest
end

#pathString (readonly)

Returns artifact directory path.

Returns:

  • (String)

    artifact directory path



125
126
127
# File 'lib/microsandbox/snapshot.rb', line 125

def path
  @path
end

#statusSymbol (readonly)

Returns :verified.

Returns:

  • (Symbol)

    :verified



127
128
129
# File 'lib/microsandbox/snapshot.rb', line 127

def status
  @status
end

Instance Method Details

#verified?Boolean

Returns whether content integrity was recorded and matched.

Returns:

  • (Boolean)

    whether content integrity was recorded and matched



142
# File 'lib/microsandbox/snapshot.rb', line 142

def verified? = @status == :verified