summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'array.c')
-rw-r--r--array.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/array.c b/array.c
index a821575..f97447f 100644
--- a/array.c
+++ b/array.c
@@ -4868,11 +4868,14 @@ rb_ary_shuffle(int argc, VALUE *argv, VALUE ary)
* If the array is empty the first form returns +nil+ and the second form
* returns an empty array.
*
- * The optional +rng+ argument will be used as the random number generator.
- *
* a = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
* a.sample #=> 7
* a.sample(4) #=> [6, 4, 2, 5]
+ *
+ * The optional +rng+ argument will be used as the random number generator.
+ *
+ * a.sample(random: Random.new(1)) #=> 6
+ * a.sample(4, random: Random.new(1)) #=> [6, 10, 9, 2]
*/