From: "Marcin Mielżyński" Date: 2006-01-25T00:41:50+09:00 Subject: Re: "self.class" vs. "(class << self; self; end)" ssmoot@gmail.com wrote: Yes there is a difference. In the first example You simply reopen a class a define a method for it. In the second example You reopen an eigenclass (which is a singleton instance of class object) and then define a method for it. Ruby returns last evaluated statement which in this case '(class << self; self; end)' is eigenclass... The eigneclass pattern (a metaclass) is a method of creating single class instances per instances of them. (I dont know if I made it clear :) ) consider: def test1() msg = 'bar' self.class.class_eval do p self define_method('foo') { msg } end end def test2 msg = 'baz' (class << self; self; end).class_eval do p self define_method('foo') { msg } end end test1 p foo test2 p foo output: Object "bar" #> "baz" lopex