nobu.nokada / softhome.net wrote:
> Szymon Drejewicz wrote:
> > a = MyObject.new
> 
> p(class << a; superclass; end)

Very nice.

Is there still a way to get the class if we do this even more crazy?

class MyObject
  def class
  end
  def type
  end
  def kind_of?(*args)
  end
  def self.===(*args)
  end
  class <<self
    alias :old_new :new
    private :old_new
  end
  def self.new(*args)
    obj = old_new(*args)
    def obj.superclass
    end
  end
end
a = MyObject.new

Or put another way, just how deep can we bury the actual type?

-- 
(\[ Kent Dahl ]/)_    _~_    __[ http://www.stud.ntnu.no/~kentda/ ]___/~
 ))\_student_/((  \__d L b__/  NTNU - graduate engineering - 5. year  )
( \__\_?|?_/__/ ) _)Industrial economics and technological management(
 \____/_?_\____/ (____engineering.discipline_=_Computer::Technology___)