Module: Mutant::Random

Defined in:
lib/mutant/random.rb

Overview

Module for generating random values

Class Method Summary collapse

Class Method Details

.fixnumFixnum

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return random fixnum

Returns:

  • (Fixnum)


21
22
23
# File 'lib/mutant/random.rb', line 21

def self.fixnum
  ::Random.rand(1000)
end

.floatFloat

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return random float

Returns:

  • (Float)


31
32
33
# File 'lib/mutant/random.rb', line 31

def self.float
  ::Random.rand
end

.hex_stringString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return random hex string

Returns:

  • (String)


11
12
13
# File 'lib/mutant/random.rb', line 11

def self.hex_string
  SecureRandom.hex(10)
end