Module RushCheck::RandomGen
In: rushcheck/random.rb

The module RandomGen is an abstract module. This is included to add instance methods. The author considers that few developers need to read this implementation. See StdGen as an example. Check also Haskell’s System.Random library.

Methods

gen_next   gen_range   split  

Public Instance methods

gen_next should be overrided as an instance method. It is assumed that gen_next returns an array with length 2. Here, call ‘Foo’ the class which includes RandomGen. The first components of the result should be an integer, and the last components should be an object which belongs to the class Foo.

gen_range should be overrided as an instance method. It is assumed that split returns an array with length 2. Here, call ‘Foo’ the class which includes RandomGen. Then the components of the result are integers where the first components should be the lowest bound of the first components of gen_next. Another should be the highest bound of the first components of gen_next.

split should be overrided as an instance method. It is assumed that split returns an array with length 2. Here, call ‘Foo’ the class which includes RandomGen. Then the components of the result are objects which belongs to the class Foo.

[Validate]