Class: Gem::Guardian::ChecksumProvider::Result

Inherits:
Data
  • Object
show all
Defined in:
lib/gem/guardian/checksum_provider.rb

Overview

Independent checksum data returned by a provider.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#providerString (readonly)

Returns provider implementation name.

Returns:

  • (String)

    provider implementation name



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/gem/guardian/checksum_provider.rb', line 28

Result = Data.define(:sha256, :source, :provider, :verification_uri) do
  # @return [Hash{Symbol => Object}] JSON-friendly representation of the provider result,
  #   including the checksum, provider name, source category, and verification URI
  def to_h
    {
      sha256: sha256,
      source: source,
      provider: provider,
      verification_uri: verification_uri
    }
  end
end

#sha256String (readonly)

Returns lowercase SHA256 hex digest.

Returns:

  • (String)

    lowercase SHA256 hex digest



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/gem/guardian/checksum_provider.rb', line 28

Result = Data.define(:sha256, :source, :provider, :verification_uri) do
  # @return [Hash{Symbol => Object}] JSON-friendly representation of the provider result,
  #   including the checksum, provider name, source category, and verification URI
  def to_h
    {
      sha256: sha256,
      source: source,
      provider: provider,
      verification_uri: verification_uri
    }
  end
end

#sourceSymbol (readonly)

Returns provider source category, such as :registry or :publisher.

Returns:

  • (Symbol)

    provider source category, such as :registry or :publisher



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/gem/guardian/checksum_provider.rb', line 28

Result = Data.define(:sha256, :source, :provider, :verification_uri) do
  # @return [Hash{Symbol => Object}] JSON-friendly representation of the provider result,
  #   including the checksum, provider name, source category, and verification URI
  def to_h
    {
      sha256: sha256,
      source: source,
      provider: provider,
      verification_uri: verification_uri
    }
  end
end

#verification_uriString? (readonly)

Returns URI a user or tool can inspect to verify the checksum source.

Returns:

  • (String, nil)

    URI a user or tool can inspect to verify the checksum source



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/gem/guardian/checksum_provider.rb', line 28

Result = Data.define(:sha256, :source, :provider, :verification_uri) do
  # @return [Hash{Symbol => Object}] JSON-friendly representation of the provider result,
  #   including the checksum, provider name, source category, and verification URI
  def to_h
    {
      sha256: sha256,
      source: source,
      provider: provider,
      verification_uri: verification_uri
    }
  end
end

Instance Method Details

#to_hHash{Symbol => Object}

Returns JSON-friendly representation of the provider result, including the checksum, provider name, source category, and verification URI.

Returns:

  • (Hash{Symbol => Object})

    JSON-friendly representation of the provider result, including the checksum, provider name, source category, and verification URI



31
32
33
34
35
36
37
38
# File 'lib/gem/guardian/checksum_provider.rb', line 31

def to_h
  {
    sha256: sha256,
    source: source,
    provider: provider,
    verification_uri: verification_uri
  }
end