Module: Predicable

Included in:
Buffer, Debrew, FormulaInstaller, Hbc::Artifact::AbstractArtifact, Hbc::Installer, Hbc::SystemCommand
Defined in:
Library/Homebrew/extend/predicable.rb

Instance Method Summary collapse

Instance Method Details

#attr_predicate(*attrs) ⇒ Object



2
3
4
5
6
7
8
# File 'Library/Homebrew/extend/predicable.rb', line 2

def attr_predicate(*attrs)
  attrs.each do |attr|
    define_method attr do
      instance_variable_get("@#{attr.to_s.sub(/\?$/, "")}") == true
    end
  end
end