brew/Library/Homebrew/extend/predicable.rb
Douglas Eichelberger d01cda2815 Turn up the types
2023-08-12 22:01:22 -07:00

14 lines
282 B
Ruby

# typed: strict
# frozen_string_literal: true
module Predicable
sig { params(attrs: Symbol).void }
def attr_predicate(*attrs)
attrs.each do |attr|
define_method attr do
instance_variable_get("@#{attr.to_s.sub(/\?$/, "")}") == true
end
end
end
end