class Ibsenphrase::Random
This encapsulates the pseudo-random number generator (PRNG), essentially turning it into a singleton class. This is done to avoid instantiating a new PRNG every time we need it, as that would make us dependent on the randomness of the operating system's seed, instead of the random number generator code in Ruby.
Public Class Methods
prng()
click to toggle source
# File lib/ibsenphrase/random.rb, line 8 def self.prng @@rng ||= ::Random.new end