You can do with some tricks as below,as Array#shuffle don't have such functionality,only n times. The doc is saying If rng is given, it will be used as the random number generator.
def shuffle!(n=7)
n.times { @cards.shuffle! }
end
If you call it a.shuffle
only one time shuffling will be done on the array a
.If you call as a.shuffle(random: Random.new(4))
,then the shuffling time is random on array a
.