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)


23
24
25
# File 'lib/mutant/random.rb', line 23

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)


33
34
35
# File 'lib/mutant/random.rb', line 33

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)


13
14
15
# File 'lib/mutant/random.rb', line 13

def self.hex_string
  SecureRandom.hex(10)
end