From: Michael Edgar Date: 2011-03-07T07:26:45+09:00 Subject: Re: How to get class of BasicObject ancestor (Ruby 1.9.2)? BasicObject as a singleton already has the class method (and it returns Class, as expected). You meant to suggest something like this: class BasicObject def class BasicObject end end But that would make any subclass of BasicObject that doesn't override this #class definition would return BasicObject, which would be odd. I'm not sure of a pure-ruby way to write #class, it's definitely written in C for the Object class. Michael Edgar adgar@carboni.ca http://carboni.ca/ On Mar 6, 2011, at 4:21 PM, 7stud -- wrote: > ...or even simpler: just open up BasicObject and monkeypatch a class > method called class(untested): > > class BasicObject > def self.class > self > end > end > > Then have at it. > > -- > Posted via http://www.ruby-forum.com/. >