tsmango / rand
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
da1d1af
commit da1d1afc8cdd8bfe9713a9d04ad0d1fd5191d0a0
tree 5aa7b79a20ee23f8d52b6c56268705b9741e55bd
parent e1fcc92306bf3b47fbd869838cd903f563214840
tree 5aa7b79a20ee23f8d52b6c56268705b9741e55bd
parent e1fcc92306bf3b47fbd869838cd903f563214840
rand /
README
Plugin Details -------------- This plugin overrides the #rand method provided to Array by Rails' ActiveSupport. It can be used like the method it overrides to return a single value, without passing in a parameter, but if you specify an integer value, a random array of that size will be returned. Examples -------- >> [0,1,2,3,4].rand => 1 >> [0,1,2,3,4].rand(2) => [4, 0] >> [0,1,2,3,4].rand(2) => [1, 2] >> [0,1,2,3,4].rand(10) => [1, 4, 3, 0, 2] >> [0,1,2,3,4].rand(10) => [2, 0, 1, 4, 3] >> [0,1,2,3,4].rand(-5) => nil License ------- This plugin is available under the MIT license. Authors ------- Thomas Mango http://slicedsoftware.com Milan Iliev http://github.com/milaniliev

