From 355379b43e0d6dd730c810fff70aaeabf830785c Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 13 Oct 2006 09:25:15 +0000 Subject: * object.c: Class#inherited RDoc added. a patch from Daniel Berger [ruby-core:08942] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- object.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'object.c') diff --git a/object.c b/object.c index 6aaecd141..7a8e9a075 100644 --- a/object.c +++ b/object.c @@ -409,6 +409,34 @@ rb_obj_is_kind_of(VALUE obj, VALUE c) } +/* + * Document-method: inherited + * + * call-seq: + * inherited(subclass) + * + * Callback invoked whenever a subclass of the current class is created. + * + * Example: + * + * class Foo + * def self.inherited(subclass) + * puts "New subclass: #{subclass}" + * end + * end + * + * class Bar < Foo + * end + * + * class Baz < Bar + * end + * + * produces: + * + * New subclass: Bar + * New subclass: Baz + */ + /* * Document-method: singleton_method_added * @@ -520,7 +548,6 @@ rb_obj_dummy(void) return Qnil; } - /* * call-seq: * obj.tainted? => true or false -- cgit