aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/predicable.rb
blob: d02fbb89be091c57715f20038d13176fd2d569f1 (plain)
1
2
3
4
5
6
7
8
9
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