brew/Library/Homebrew/checksum.rb
Mike McQuaid 6693915399 rubocop --auto-correct all remaining files.
But remove some manual `.freeze`s on constants that shouldn't be
constants.
2016-09-17 16:14:13 +01:00

20 lines
346 B
Ruby

class Checksum
attr_reader :hash_type, :hexdigest
alias_method :to_s, :hexdigest
TYPES = [:sha256].freeze
def initialize(hash_type, hexdigest)
@hash_type = hash_type
@hexdigest = hexdigest
end
def empty?
hexdigest.empty?
end
def ==(other)
hash_type == other.hash_type && hexdigest == other.hexdigest
end
end