--------------020409050801010005050908
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Here's a better version of my solution. Obviously these modules would
have to be included in Object to work. The names should be self
explainitory. All lines are less than 80 chars.
module Attribute20PercentGolfed
def attribute(arg, &b)
return attribute(arg.keys[0]) { arg.values[0] } if arg.class Hash
define_method(arg) do
init lock_given? && !instance_eval("defined? "+"@"+arg)
init ? send(arg+"