free_mutant/lib/mutant/random.rb
Markus Schirp 7f3797ffa1 Introduce Mutant::Random
* Cleans up naming duplication from the Mutant.random_* names.
2012-07-31 20:11:37 +02:00

34 lines
501 B
Ruby

module Mutant
# Module for generating random values
module Random
# Return random hex string
#
# @return [String]
#
# @api private
#
def self.hex_string
SecureRandom.hex(10)
end
# Return random fixnum
#
# @return [Fixnum]
#
# @api private
#
def self.fixnum
Random.rand(1000)
end
# Return random float
#
# @return [Float]
#
# @api private
#
def self.float
Random.rand
end
end
end