Class: Microsandbox::SnapshotVerifyReport

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

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#algorithmString? (readonly)

Returns digest algorithm (when :verified).

Returns:

  • (String, nil)

    digest algorithm (when :verified)



59
60
61
# File 'lib/microsandbox/snapshot.rb', line 59

def algorithm
  @algorithm
end

#content_digestString? (readonly)

Returns matched content digest (when :verified).

Returns:

  • (String, nil)

    matched content digest (when :verified)



61
62
63
# File 'lib/microsandbox/snapshot.rb', line 61

def content_digest
  @content_digest
end

#digestString (readonly)

Returns manifest digest.

Returns:

  • (String)

    manifest digest



53
54
55
# File 'lib/microsandbox/snapshot.rb', line 53

def digest
  @digest
end

#pathString (readonly)

Returns artifact directory path.

Returns:

  • (String)

    artifact directory path



55
56
57
# File 'lib/microsandbox/snapshot.rb', line 55

def path
  @path
end

#statusSymbol (readonly)

Returns :not_recorded or :verified.

Returns:

  • (Symbol)

    :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.

Returns:

  • (Boolean)

    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.

Returns:

  • (Boolean)

    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