From: Michel Demazure Date: 2012-06-25T23:53:51+09:00 Subject: Array#sample is Set#sample and not Array#sample ! Arrays are ordered, sets are not. Sampling an array should give random elements in the good order. But : irb(main):001:0> (0..10).to_a.sample(5) => [8, 10, 4, 6, 7] Today's Array#sample actually is Set#sample, but Set#sample does not exist. irb(main):002:0> Set.new((0..10)).sample(5) NoMethodError: undefined method `sample' for # _md -- Posted via http://www.ruby-forum.com/.