2009-11-16から1日間の記事一覧

Three implicit contexts in Ruby

Yehuda Katz wrote an article about self and metaclass. In the article he said that Person.instance_eval assigns Person's metaclass to self for a class Person. But this is obviously wrong.class Person; end Person.instance_eval{ p self } #=>…