From 559cad9f2d87721fda1ffbf2e39ce4b328a5b17f Mon Sep 17 00:00:00 2001 From: okuramasafumi Date: Sat, 4 May 2019 21:54:25 +0900 Subject: 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 --- enum.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'enum.c') diff --git a/enum.c b/enum.c index fc783211cf..906a13eaa7 100644 --- a/enum.c +++ b/enum.c @@ -2301,10 +2301,10 @@ member_i(RB_BLOCK_CALL_FUNC_ARGLIST(iter, args)) * Returns true if any member of enum equals * obj. Equality is tested using ==. * - * 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 * */ -- cgit v1.2.3