brew/Library/Homebrew/extend/predicable.rb
2019-04-20 13:27:36 +09:00

12 lines
229 B
Ruby

# 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