aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/module.rb
blob: 9210793f67e594706f5eafbb8d97cf969dbc9326 (plain)
1
2
3
4
5
6
7
8
9
10
11
class Module
  def attr_rw(*attrs)
    attrs.each do |attr|
      module_eval <<-EOS, __FILE__, __LINE__ + 1
        def #{attr}(val=nil)
          val.nil? ? @#{attr} : @#{attr} = val
        end
      EOS
    end
  end
end