Class: Checksum

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

Constant Summary

TYPES =
[:sha256].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash_type, hexdigest) ⇒ Checksum



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

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



4
5
6
# File 'Library/Homebrew/checksum.rb', line 4

def hash_type
  @hash_type
end

#hexdigestObject (readonly)

Returns the value of attribute hexdigest



4
5
6
# File 'Library/Homebrew/checksum.rb', line 4

def hexdigest
  @hexdigest
end

Instance Method Details

#==(other) ⇒ Object



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

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