brew/Library/Homebrew/extend/predicable.rb
2017-06-28 09:25:31 +02:00

10 lines
198 B
Ruby

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