
6 Nov
2023
6 Nov
'23
5:33 a.m.
Issue #19987 has been updated by nobu (Nobuyoshi Nakada). Maybe what you want is `Random#rand` with a `Range`? ```ruby r = Random.new 5.times.map {r.rand(0..99)} #=> [83, 63, 43, 70, 90] ``` ---------------------------------------- Feature #19987: add sample method to Range https://bugs.ruby-lang.org/issues/19987#change-105168 * Author: horv77@protonmail.com (Andras Horvath) * Status: Feedback * Priority: Normal ---------------------------------------- Dear Devs, I'd like to suggest a change. Since the following works: (1..99).first(5) Therefore this one could be logical and useful to work: (1..99).sample(5) Thanks, Andras -- https://bugs.ruby-lang.org/