Ruby 2.7.0 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Randomクラス > ==
self == other -> bool
[permalink][rdoc]乱数生成器が等しい状態であるならばtrue を返します。
r1 = Random.new(1)
r2 = Random.new(1)
p r1 == r2 # => true
r2.rand
p r1 == r2 # => false
r1.rand
p r1 == r2 # => true