Skip to content

Commit 4943992

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/master'
2 parents 8dfbefb + bd832c8 commit 4943992

File tree

1 file changed

+8
-0
lines changed
  • refm/api/src/_builtin

1 file changed

+8
-0
lines changed

refm/api/src/_builtin/Array

+8
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,14 @@ p a.sample(3) #=> [1, 9, 3]
22582258
p a #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
22592259
#@end
22602260

2261+
random [[c:SecureRandom]] などの乱数生成器を渡すことができます。
2262+
2263+
#@samplecode 例
2264+
require 'securerandom'
2265+
a = (1..10).to_a
2266+
p a.sample(random: SecureRandom) #=> 2
2267+
#@end
2268+
22612269
--- cycle(n=nil) {|obj| block } -> nil
22622270
#@since 1.9.1
22632271
--- cycle(n=nil) -> Enumerator

0 commit comments

Comments
 (0)