summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authorstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-12 21:11:54 (GMT)
committerstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-12 21:11:54 (GMT)
commit863a2a1fc8a1bdcdea6601a805bf42b2435168e7 (patch)
tree525c476675ba761fee11739e83a25b1a6f4934cc /range.c
parent08d01949bf021062cf4dc040acdfa944e97c0690 (diff)
range.c: [DOC] improve docs for Range#cover?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
-rw-r--r--range.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/range.c b/range.c
index 07008ca..9661feb 100644
--- a/range.c
+++ b/range.c
@@ -1360,15 +1360,16 @@ static int r_cover_range_p(VALUE range, VALUE beg, VALUE end, VALUE val);
* 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