From 813d0ef7ad5ccb23b421ea74f942e12be5b2a356 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/branches/ruby_1_8@11150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ object.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 186c759fa..634582707 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Oct 13 18:19:31 2006 Yukihiro Matsumoto + + * object.c: Class#inherited RDoc added. a patch from Daniel + Berger [ruby-core:08942] + Fri Oct 13 02:30:12 2006 Nobuyoshi Nakada * lib/test/unit/collector/dir.rb (Collector::Dir#collect): prepend diff --git a/object.c b/object.c index 5f97357e7..3719817d8 100644 --- a/object.c +++ b/object.c @@ -494,6 +494,34 @@ rb_obj_is_kind_of(obj, 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 * @@ -605,7 +633,6 @@ rb_obj_dummy() return Qnil; } - /* * call-seq: * obj.tainted? => true or false -- cgit