blob: 506885fce30835a17c0fa1627270ce08f55445a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
class Checksum
extend Forwardable
attr_reader :hash_type, :hexdigest
TYPES = [:sha256].freeze
def initialize(hash_type, hexdigest)
@hash_type = hash_type
@hexdigest = hexdigest
end
delegate [:empty?, :to_s] => :@hexdigest
def ==(other)
hash_type == other.hash_type && hexdigest == other.hexdigest
end
end
|