summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authorokuramasafumi <masafumi.o1988@gmail.com>2019-05-04 21:54:25 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-05-13 00:43:05 +0900
commit559cad9f2d87721fda1ffbf2e39ce4b328a5b17f (patch)
tree7d80dc976b008fa3b55432a8028213e589068d27 /enum.c
parent33bce2585ffacd8cf762972da7ca7a99d804989f (diff)
Improve doc for Enumerable#include? and member?
Existing doc for Enumerable#include? and member? has some problems. * `IO.constants` is not commonly used, and only some know that `SEEK_SET` is actually included in constants. * `IO.constants` is actually an Array, not the example is not appropriate for `Enumerable` module. So in this commit, the old example is replaced with new one. New example uses integer range, which is much simpler and easier to understand. Closes: https://github.com/ruby/ruby/pull/2168
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/enum.c b/enum.c
index fc78321..906a13e 100644
--- a/enum.c
+++ b/enum.c
@@ -2301,10 +2301,10 @@ member_i(RB_BLOCK_CALL_FUNC_ARGLIST(iter, args))
* Returns <code>true</code> if any member of <i>enum</i> equals
* <i>obj</i>. Equality is tested using <code>==</code>.
*
- * IO.constants.include? :SEEK_SET #=> true
- * IO.constants.include? :SEEK_NO_FURTHER #=> false
- * IO.constants.member? :SEEK_SET #=> true
- * IO.constants.member? :SEEK_NO_FURTHER #=> false
+ * (1..10).include? 5 #=> true
+ * (1..10).include? 15 #=> false
+ * (1..10).member? 5 #=> true
+ * (1..10).member? 15 #=> false
*
*/