summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--object.c29
2 files changed, 33 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 31ebf25529..28958b70bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Oct 13 18:19:31 2006 Yukihiro Matsumoto <[email protected]>
+
+ * object.c: Class#inherited RDoc added. a patch from Daniel
+ Berger <djberg96 at gmail.com> [ruby-core:08942]
+
Fri Oct 13 02:42:00 2006 Akinori MUSHA <[email protected]>
* ext/digest/digest.c (rb_digest_base_equal): Should call digest()
diff --git a/object.c b/object.c
index 6aaecd1418..7a8e9a0750 100644
--- a/object.c
+++ b/object.c
@@ -410,6 +410,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
*
* call-seq:
@@ -520,7 +548,6 @@ rb_obj_dummy(void)
return Qnil;
}
-
/*
* call-seq:
* obj.tainted? => true or false