#!/usr/bin/env ruby # This code comes from http://ruby-it.org/pages/Singleton+Class # Check the page for copyright notice and explanations class Class def new(*args, &block) obj = allocate obj.send(:initialize, *args, &block) obj end end class A < Array end Class < Module < Object (Class) < (Module) < (Object) < Class A < Array < Object (A) < (Array) < (Object) a = [] class << a def tt end end