summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
Diffstat (limited to 'range.c')
-rw-r--r--range.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/range.c b/range.c
index a6bf0fca51..cafe57ab77 100644
--- a/range.c
+++ b/range.c
@@ -2438,8 +2438,12 @@ range_overlap(VALUE range, VALUE other)
* A beginless range may be used to slice an array:
*
* a = [1, 2, 3, 4]
- * r = (..2) # => nil...2
- * a[r] # => [1, 2]
+ * # Include the third array element in the slice
+ * r = (..2) # => nil..2
+ * a[r] # => [1, 2, 3]
+ * # Exclude the third array element from the slice
+ * r = (...2) # => nil...2
+ * a[r] # => [1, 2]
*
* \Method +each+ for a beginless range raises an exception.
*