--------------060908050001010004030905
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Ruby Quiz wrote:

> 	# metakoans.rb is an arduous set of exercises designed to stretch
> 	# meta-programming muscle.  the focus is on a single method 'attribute' which
> 	# behaves much like the built-in 'attr', but whose properties require delving
> 	# deep into the depths of meta-ruby.

Here we go then.

I have a golfed (8 lines) and a regular solution (21 lines) and 
generally do the simplest thing that makes the tests work.

Got it to run in two tries by the way. I failed the fourtytwo test at 
first. After that everything worked fine. :)

And thanks for a great quiz. Being able to do things test first rules!

-- 
http://flgr.0x42.net/

--------------060908050001010004030905
Content-Type: application/x-ruby;
 namelgr-metakoans-golfed.rb"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filenamelgr-metakoans-golfed.rb"

Y2xhc3MgTW9kdWxlOyBkZWYgYXR0cmlidXRlKG5hbWUsICZibG9jaykNCiAgbmFtZSwgZGVm
YXVsdCA9ICpuYW1lLnNoaWZ0IGlmIG5hbWUuaXNfYT8oSGFzaCkNCiAgaXZhciwgZGVmYXVs
dF9sYW1iZGEgPSAiQCN7bmFtZX0iLCBibG9jayB8fCBsYW1iZGEgeyBkZWZhdWx0IH0NCiAg
ZGVmaW5lX21ldGhvZCg6IiN7bmFtZX09IikgeyB8dmFsfCBpbnN0YW5jZV92YXJpYWJsZV9z
ZXQoaXZhciwgdmFsKSB9DQogIGRlZmluZV9tZXRob2QobmFtZSkgeyBpbnN0YW5jZV92YXJp
YWJsZXMuaW5jbHVkZT8oaXZhcikgPw0KICAgIGluc3RhbmNlX3ZhcmlhYmxlX2dldChpdmFy
KSA6IGluc3RhbmNlX2V2YWwoJmRlZmF1bHRfbGFtYmRhKSB9DQogIGFsaWFzX21ldGhvZCg6
IiN7bmFtZX0/IiwgbmFtZSkNCmVuZDsgZW5kDQo--------------060908050001010004030905
Content-Type: application/x-ruby;
 namelgr-metakoans.rb"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filenamelgr-metakoans.rb"

Y2xhc3MgTW9kdWxlDQogIGRlZiBhdHRyaWJ1dGUobmFtZSwgJmJsb2NrKQ0KICAgIG5hbWUs
IGRlZmF1bHQgPSAqbmFtZS5zaGlmdCBpZiBuYW1lLmlzX2E/KEhhc2gpDQogICAgZGVmYXVs
dF9sYW1iZGEgPSBibG9jayB8fCBsYW1iZGEgeyBkZWZhdWx0IH0NCiAgICBpdmFyID0gIkAj
e25hbWV9Ig0KDQogICAgZGVmaW5lX21ldGhvZCg6IiN7bmFtZX09IikgZG8gfG5ld192YWx1
ZXwNCiAgICAgIGluc3RhbmNlX3ZhcmlhYmxlX3NldChpdmFyLCBuZXdfdmFsdWUpDQogICAg
ZW5kDQoNCiAgICBkZWZpbmVfbWV0aG9kKG5hbWUpIGRvDQogICAgICBpZiBpbnN0YW5jZV92
YXJpYWJsZXMuaW5jbHVkZT8oaXZhcikgdGhlbg0KICAgICAgICBpbnN0YW5jZV92YXJpYWJs
ZV9nZXQoaXZhcikNCiAgICAgIGVsc2UNCiAgICAgICAgaW5zdGFuY2VfZXZhbCgmZGVmYXVs
dF9sYW1iZGEpDQogICAgICBlbmQNCiAgICBlbmQNCg0KICAgIGFsaWFzX21ldGhvZCg6IiN7
bmFtZX0/IiwgbmFtZSkNCiAgZW5kDQplbmQNCg--------------060908050001010004030905--