mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
13 lines
243 B
Ruby
13 lines
243 B
Ruby
# typed: true
|
|
# frozen_string_literal: true
|
|
|
|
module Predicable
|
|
def attr_predicate(*attrs)
|
|
attrs.each do |attr|
|
|
define_method attr do
|
|
instance_variable_get("@#{attr.to_s.sub(/\?$/, "")}") == true
|
|
end
|
|
end
|
|
end
|
|
end
|