Monday, April 23, 2007

The best explanation of metaclasses in Ruby I've found

I stumbled across "seeingMetaclassesClearly.html " today. I don't know how I never came across it. It's definately the best explanation of metaclasses in Ruby I've ever read. Now the whole "class << obj; def meth; puts "hello from the metaclass"; end; end;" syntax makes sense. Previously I had used "obj.extend(module)" before but the former is obviously more convenient if you are in a class definition.

No comments:

Tags

my google reader feed