aboutsummaryrefslogtreecommitdiffstats
path: root/array.c
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-24 13:40:28 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-24 13:40:28 +0000
commit2091ccac8859f9f4bdd0914619122fe7e6173a9c (patch)
treeb3cddf5cb3a54c1354ae41ffff099af9a3db9981 /array.c
parentff9c54a32d860fbb609870570c16c2a5774d9e89 (diff)
downloadruby-2091ccac8859f9f4bdd0914619122fe7e6173a9c.tar.gz
* array.c: [DOC] Add more documents to shuffle! and shuffle.
Contributed by @JuanitoFatas [ci skip][fix GH-612] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/array.c b/array.c
index 915cb566d1..ca3b8a4769 100644
--- a/array.c
+++ b/array.c
@@ -4459,7 +4459,13 @@ static ID id_random;
*
* Shuffles elements in +self+ in place.
*
+ * a = [ 1, 2, 3 ] #=> [1, 2, 3]
+ * a.shuffle! #=> [2, 3, 1]
+ * a #=> [2, 3, 1]
+ *
* The optional +rng+ argument will be used as the random number generator.
+ *
+ * a.shuffle!(random: Random.new(1)) #=> [1, 3, 2]
*/
static VALUE
@@ -4506,6 +4512,7 @@ rb_ary_shuffle_bang(int argc, VALUE *argv, VALUE ary)
*
* a = [ 1, 2, 3 ] #=> [1, 2, 3]
* a.shuffle #=> [2, 3, 1]
+ * a #=> [1, 2, 3]
*
* The optional +rng+ argument will be used as the random number generator.
*