Class: Checksum

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

Constant Summary collapse

TYPES =
[:sha256].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash_type, hexdigest) ⇒ Checksum

Returns a new instance of Checksum



10
11
12
13
# File 'brew/Library/Homebrew/checksum.rb', line 10

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

Instance Attribute Details

#hash_typeObject (readonly)

Returns the value of attribute hash_type



6
7
8
# File 'brew/Library/Homebrew/checksum.rb', line 6

def hash_type
  @hash_type
end

#hexdigestObject (readonly)

Returns the value of attribute hexdigest



6
7
8
# File 'brew/Library/Homebrew/checksum.rb', line 6

def hexdigest
  @hexdigest
end

Instance Method Details

#==(other) ⇒ Object



17
18
19
# File 'brew/Library/Homebrew/checksum.rb', line 17

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