[前][次][番号順一覧][スレッド一覧]

ruby-changes:59717

From: Marc-Andre <ko1@a...>
Date: Fri, 17 Jan 2020 04:31:51 +0900 (JST)
Subject: [ruby-changes:59717] 8ab11096ef (master): Clarify documentation for Module#included_modules and Module#included?

https://git.ruby-lang.org/ruby.git/commit/?id=8ab11096ef

From 8ab11096ef3e0cf594308da285af2257cb4f5291 Mon Sep 17 00:00:00 2001
From: Marc-Andre Lafortune <github@m...>
Date: Thu, 16 Jan 2020 13:28:37 -0600
Subject: Clarify documentation for Module#included_modules and
 Module#included?

[DOC] [ci skip] [Bug #8841]

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) https://github.com/ruby/ruby/blob/trunk/class.c#L1022
  *  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) https://github.com/ruby/ruby/blob/trunk/class.c#L1061
  *  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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]