class Module # Modifies attr_writer to return an array # of the names of the methods it has defined. def attr_writer(*args) made = [] args.each { |a| a = a.to_s.strip.chomp('=') module_eval %Q{ def #{a}=(x); @#{a} = x ; end } made << "#{a}=".to_sym } return *made end end