>>>>> "N" == Nathan Smith <nsmith5 / umbc.edu> writes:

N> Inside of a class instance method, self.class returns a reference to the
N> metaclass of the class. Calling superclass on the metaclass returns
N> another metaclass, and you're right -- it will print A.hi (as I said =])

 re read your example

N> class B < A
N>   def hi
N>    self.class.superclass.hi
N>  end
N> end

moulon% cat b.rb
#!/usr/bin/ruby
class A
end

class B < A
   def hi
      p self.class
      p class << self.class; self end
   end
end

B.new.hi
moulon% 

moulon% ./b.rb
B
#<Class:B>
moulon% 


 You really think that self.class, i.e. B, make reference to the singleton
 class of B ?


Guy Decoux