diff options
author | okuramasafumi <masafumi.o1988@gmail.com> | 2019-05-04 21:54:25 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2019-05-13 00:43:05 +0900 |
commit | 559cad9f2d87721fda1ffbf2e39ce4b328a5b17f (patch) | |
tree | 7d80dc976b008fa3b55432a8028213e589068d27 /enum.c | |
parent | 33bce2585ffacd8cf762972da7ca7a99d804989f (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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 * */ |