Module: RushCheck::RandomGen
Overview
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.
Instance Method Summary collapse
-
#gen_next ⇒ Object
gen_next should be overrided as an instance method.
-
#gen_range ⇒ Object
gen_range should be overrided as an instance method.
-
#split ⇒ Object
split should be overrided as an instance method.
Instance Method Details
#gen_next ⇒ Object
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.
27 28 29 |
# File 'lib/rushcheck/random.rb', line 27 def gen_next raise_not_implemented_error end |
#gen_range ⇒ Object
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.
47 48 49 |
# File 'lib/rushcheck/random.rb', line 47 def gen_range raise_not_implemented_error end |
#split ⇒ Object
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.
36 37 38 |
# File 'lib/rushcheck/random.rb', line 36 def split raise_not_implemented_error end |