Cask::DSL::DependsOn: add empty?, present? methods

`#present?` is called on a `DependsOn` object in `Cask::DSL` and this
is seemingly deferred to the underlying hash object but Sorbet doesn't
understand this kind of `SimpleDelegator` magic. This adds `empty?`
and `present?` methods that explicitly interact with the hash in a
way that Sorbet can understand.
This commit is contained in:
Sam Ford 2025-04-22 16:39:55 -04:00
parent 3d2ab610c9
commit c495aa3e63
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D

View File

@ -82,6 +82,12 @@ module Cask
@arch.concat(arches.map { |arch| VALID_ARCHES[arch] })
end
sig { returns(T::Boolean) }
def empty? = T.let(__getobj__, T::Hash[Symbol, T.untyped]).empty?
sig { returns(T::Boolean) }
def present? = !empty?
end
end
end