Merge pull request #17151 from alebcay/checksum-strict-typing
checksum: enable strict typing
This commit is contained in:
		
						commit
						f5cde8ad0d
					
				@ -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