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

#providerObject (readonly)

Returns the value of attribute provider

Returns:

  • (Object)

    the current value of provider



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

#sha256Object (readonly)

Returns the value of attribute sha256

Returns:

  • (Object)

    the current value of sha256



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

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of 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

#verification_uriObject (readonly)

Returns the value of attribute verification_uri

Returns:

  • (Object)

    the current value of verification_uri



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