From: Love U Ruby Date: 2013-05-14T16:04:28+09:00 Subject: Re: callback limitations with `inherited` Josh Cheek wrote in post #1108884: > On Mon, May 13, 2013 at 1:23 PM, Love U Ruby > wrote: Thanks for your time. > So when we subclass, we can see that there are actually two classes who get their superclass changed. ** We might expect, then, that if we defined theinherited method on C's singleton class, that it would be called,because D's singleton class subclasses it:** -- Yes I thought that and also what would be the reason not to happen it with `singleton class`? that's my curiosity. > class C > class << self > def self.inherited(subclass) > puts "C's singleton class just got subclassed by #{subclass}" > end > end > def self.inherited(subclass) > puts "#{self} just got subclassed by #{subclass}." > end > end > > > However, only C.inherited is called, not C.singleton_class.inherited -- Posted via http://www.ruby-forum.com/.