free_mutant/lib/mutant/random.rb
2012-12-10 17:11:08 +01:00

35 lines
506 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