checksum: enable strict typing
This commit is contained in:
parent
f381b2cdf7
commit
58b50badef
@ -1,4 +1,4 @@
|
||||
# typed: true
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
# A formula's checksum.
|
||||
@ -7,14 +7,17 @@
|
||||
class Checksum
|
||||
extend Forwardable
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :hexdigest
|
||||
|
||||
sig { params(hexdigest: String).void }
|
||||
def initialize(hexdigest)
|
||||
@hexdigest = hexdigest.downcase
|
||||
@hexdigest = T.let(hexdigest.downcase, String)
|
||||
end
|
||||
|
||||
delegate [:empty?, :to_s, :length, :[]] => :@hexdigest
|
||||
|
||||
sig { params(other: T.any(String, Checksum, Symbol)).returns(T::Boolean) }
|
||||
def ==(other)
|
||||
case other
|
||||
when String
|
||||
|
Loading…
x
Reference in New Issue
Block a user