From 81a77fe64547da2446b44f1771755185d547c09a Mon Sep 17 00:00:00 2001 From: Sean Marcia Date: Tue, 3 Jan 2012 15:45:53 -0500 Subject: [PATCH] Added documentation for Array#sample --- array.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/array.c b/array.c index 01cabc87b9813c..fc5fb18c5bc6df 100644 --- a/array.c +++ b/array.c @@ -3952,7 +3952,10 @@ rb_ary_shuffle(int argc, VALUE *argv, VALUE ary) * contained duplicate elements. If the array is empty the first form returns * nil and the second form returns an empty array. * - * If +rng+ is given, it 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] */