module Burocracia::Generator

Overview

Module responsible for generating randomic low-level information

Extended Modules

Defined in:

burocracia/generator.cr

Instance Method Summary

Instance Method Detail

def random_numbers(size, randomifier = Random) #

Generates a string with random numbers.

Burocracia::Generator.random_numbers(size: 3)
=> "139"

If needed, you can pass your own Random instance:

Burocracia::Generator.random_numbers(size: 5, randomifier: MyRandomClass)
=> "002"

NOTE The randomifier class or module must implement a function called rand that accepts a Range and returns an Object with a to_s method.


[View source]