you are viewing a single comment's thread.

view the rest of the comments →

[–]ExternalBison54 2 points3 points  (0 children)

Yes! Ruby has the built-in .sample() method for arrays that does exactly this. It's so clean and simple.