summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2021-12-03 07:12:28 -0600
committerGitHub <noreply@github.com>2021-12-03 07:12:28 -0600
commit28fb6d6b9e06a632f96244a635a045622a6be276 (patch)
tree1c96616dc764d2b67c83fe9443b7f5ae1f8c9ea8 /range.c
parent324d57df0b28982590609d7ae080f82074a82a5c (diff)
downloadruby-28fb6d6b9e06a632f96244a635a045622a6be276.tar.gz
Adding links to literals and Kernel (#5192)
* Adding links to literals and Kernel
Diffstat (limited to 'range.c')
-rw-r--r--range.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/range.c b/range.c
index 6ac7d794c6..6eb7842313 100644
--- a/range.c
+++ b/range.c
@@ -2050,14 +2050,16 @@ range_count(int argc, VALUE *argv, VALUE range)
/* A \Range object represents a collection of values
* that are between given begin and end values.
*
- * A range may be created using a literal:
- *
- * # Ranges that use '..' to include the given end value.
- * (1..4).to_a # => [1, 2, 3, 4]
- * ('a'..'d').to_a # => ["a", "b", "c", "d"]
- * # Ranges that use '...' to exclude the given end value.
- * (1...4).to_a # => [1, 2, 3]
- * ('a'...'d').to_a # => ["a", "b", "c"]
+ * You can create an \Range object explicitly with:
+ *
+ * - A {range literal}[doc/syntax/literals_rdoc.html#label-Range+Literals]:
+ *
+ * # Ranges that use '..' to include the given end value.
+ * (1..4).to_a # => [1, 2, 3, 4]
+ * ('a'..'d').to_a # => ["a", "b", "c", "d"]
+ * # Ranges that use '...' to exclude the given end value.
+ * (1...4).to_a # => [1, 2, 3]
+ * ('a'...'d').to_a # => ["a", "b", "c"]
*
* A range may be created using method Range.new:
*