summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2020-01-16 13:28:37 -0600
committerMarc-Andre Lafortune <github@marc-andre.ca>2020-01-16 13:31:25 -0600
commit8ab11096ef3e0cf594308da285af2257cb4f5291 (patch)
tree5a8b4a4669a0c65dae34a9c2c019916af0325027 /class.c
parent95301378fc3b41528b4264de54722a0e7be0e875 (diff)
Clarify documentation for Module#included_modules and Module#included?
[DOC] [ci skip] [Bug #8841]
Diffstat (limited to 'class.c')
-rw-r--r--class.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/class.c b/class.c
index 66c149b..46f7cc3 100644
--- a/class.c
+++ b/class.c
@@ -1022,17 +1022,22 @@ rb_prepend_module(VALUE klass, VALUE module)
* call-seq:
* mod.included_modules -> array
*
- * Returns the list of modules included in <i>mod</i>.
+ * Returns the list of modules included or prepended in <i>mod</i>
+ * or one of <i>mod</i>'s ancestors.
+ *
+ * module Sub
+ * end
*
* module Mixin
+ * prepend Sub
* end
*
* module Outer
* include Mixin
* end
*
- * Mixin.included_modules #=> []
- * Outer.included_modules #=> [Mixin]
+ * Mixin.included_modules #=> [Sub]
+ * Outer.included_modules #=> [Sub, Mixin]
*/
VALUE
@@ -1056,8 +1061,8 @@ rb_mod_included_modules(VALUE mod)
* call-seq:
* mod.include?(module) -> true or false
*
- * Returns <code>true</code> if <i>module</i> is included in
- * <i>mod</i> or one of <i>mod</i>'s ancestors.
+ * Returns <code>true</code> if <i>module</i> is included
+ * or prepended in <i>mod</i> or one of <i>mod</i>'s ancestors.
*
* module A
* end