module FFaker::RandomUtils
def fetch_sample(list, options = {})
* Pass `count: n` in options argument, where `n` is an integer, to
* Returns one random item from `list`.
Generator so that the results are deterministic.
Performs Array#sample on `list` using a the internal Random Number
def fetch_sample(list, options = {}) if (count = options.delete(:count)) list.sample(count, random: FFaker::Random) else list.sample(random: FFaker::Random) end end
def rand(max = nil)
Returns a randon number from the internal Random Number Generator. Can be
def rand(max = nil) FFaker::Random.rand(max) end
def shuffle(list)
copy of `list`) except that it uses the internal Random Number Generator
Performs same action as as `Array#suffle` (returns a randomly-reordered
def shuffle(list) list.shuffle(random: FFaker::Random) end