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.



94
95
96
97
98
99
100
# File 'lib/microsandbox/snapshot.rb', line 94

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)



90
91
92
# File 'lib/microsandbox/snapshot.rb', line 90

def algorithm
  @algorithm
end

#content_digestString? (readonly)

Returns matched content digest (when :verified).

Returns:

  • (String, nil)

    matched content digest (when :verified)



92
93
94
# File 'lib/microsandbox/snapshot.rb', line 92

def content_digest
  @content_digest
end

#digestString (readonly)

Returns manifest digest.

Returns:

  • (String)

    manifest digest



84
85
86
# File 'lib/microsandbox/snapshot.rb', line 84

def digest
  @digest
end

#pathString (readonly)

Returns artifact directory path.

Returns:

  • (String)

    artifact directory path



86
87
88
# File 'lib/microsandbox/snapshot.rb', line 86

def path
  @path
end

#statusSymbol (readonly)

Returns :not_recorded or :verified.

Returns:

  • (Symbol)

    :not_recorded or :verified



88
89
90
# File 'lib/microsandbox/snapshot.rb', line 88

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



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

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



103
104
# File 'lib/microsandbox/snapshot.rb', line 103

def verified? = @status == :verified
# @return [Boolean] whether no integrity descriptor was recorded