diff options
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -3953,6 +3953,10 @@ rb_ary_shuffle(int argc, VALUE *argv, VALUE ary) * <code>nil</code> 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] */ |