Class: Checksum Private

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
Library/Homebrew/checksum.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A formula's checksum.

Constant Summary collapse

TYPES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

[:sha256].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash_type, hexdigest) ⇒ Checksum

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Checksum.


13
14
15
16
# File 'Library/Homebrew/checksum.rb', line 13

def initialize(hash_type, hexdigest)
  @hash_type = hash_type
  @hexdigest = hexdigest
end

Instance Attribute Details

#hash_typeObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


9
10
11
# File 'Library/Homebrew/checksum.rb', line 9

def hash_type
  @hash_type
end

#hexdigestObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


9
10
11
# File 'Library/Homebrew/checksum.rb', line 9

def hexdigest
  @hexdigest
end

Instance Method Details

#==(other) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


20
21
22
# File 'Library/Homebrew/checksum.rb', line 20

def ==(other)
  hash_type == other&.hash_type && hexdigest == other.hexdigest
end