2012-07-31 14:11:37 -04:00
|
|
|
module Mutant
|
|
|
|
# Module for generating random values
|
|
|
|
module Random
|
2012-12-10 11:11:08 -05:00
|
|
|
|
2012-07-31 14:11:37 -04:00
|
|
|
# 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
|
2012-08-14 16:45:34 -04:00
|
|
|
::Random.rand(1000)
|
2012-07-31 14:11:37 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
# Return random float
|
|
|
|
#
|
|
|
|
# @return [Float]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def self.float
|
2012-08-14 16:45:34 -04:00
|
|
|
::Random.rand
|
2012-07-31 14:11:37 -04:00
|
|
|
end
|
2013-06-14 14:54:02 -04:00
|
|
|
|
|
|
|
end # Random
|
|
|
|
end # Mutant
|