free_mutant/lib/mutant/random.rb
Dan Kubb 7293386c26 Add magic encoding header to all ruby files
* rubocop still warns about this on ruby 1.9.3, so it was fixed so
  it produces less output on travis.
2013-07-28 16:03:06 -07:00

38 lines
544 B
Ruby

# encoding: utf-8
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 # Random
end # Mutant