ruby-changes:52829
From: stomar <ko1@a...>
Date: Sat, 13 Oct 2018 06:11:59 +0900 (JST)
Subject: [ruby-changes:52829] stomar:r65041 (trunk): range.c: [DOC] improve docs for Range#cover?
stomar 2018-10-13 06:11:54 +0900 (Sat, 13 Oct 2018) New Revision: 65041 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65041 Log: range.c: [DOC] improve docs for Range#cover? Modified files: trunk/range.c Index: range.c =================================================================== --- range.c (revision 65040) +++ range.c (revision 65041) @@ -1360,15 +1360,16 @@ static int r_cover_range_p(VALUE range, https://github.com/ruby/ruby/blob/trunk/range.c#L1360 * This tests <code>begin <= obj <= end</code> when #exclude_end? is +false+ * and <code>begin <= obj < end</code> when #exclude_end? is +true+. * - * Returns <code>true</code> for a Range when it is covered by the reciver, + * If called with a Range argument, returns <code>true</code> when the + * given range is covered by the receiver, * by comparing the begin and end values. If the argument can be treated as * a sequence, this method treats it that way. In the specific case of * <code>(a..b).cover?(c...d)</code> with <code>a <= c && b < d</code>, - * end of sequence must be calculated, which may exhibit poor performance if - * c is non-numeric. Returns <code>false</code> if the begin value of the - * Range is larger than the end value. + * the end of the sequence must be calculated, which may exhibit poor + * performance if <code>c</code> is non-numeric. + * Returns <code>false</code> if the begin value of the + * range is larger than the end value. * - * Return * ("a".."z").cover?("c") #=> true * ("a".."z").cover?("5") #=> false * ("a".."z").cover?("cc") #=> true -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/