Class: RushCheck::TheStdGen
- Includes:
- RandomGen, Singleton
- Defined in:
- lib/rushcheck/random.rb
Overview
TheStdGen is a singleton class to get the unique random number generator using StdGen. TheStdGen includes ruby’s Singleton module.
Instance Attribute Summary
Attributes inherited from StdGen
Instance Method Summary collapse
- #gen_next ⇒ Object
- #gen_range ⇒ Object
-
#initialize ⇒ TheStdGen
constructor
A new instance of TheStdGen.
- #split ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Method Details
#gen_next ⇒ Object
133 134 135 136 137 |
# File 'lib/rushcheck/random.rb', line 133 def gen_next @gen, result = @gen.split result.gen_next end |
#gen_range ⇒ Object
150 151 152 |
# File 'lib/rushcheck/random.rb', line 150 def gen_range @gen.gen_range end |
#split ⇒ Object
139 140 141 142 143 144 |
# File 'lib/rushcheck/random.rb', line 139 def split result = @gen.split @gen = @gen.gen_next[1] result end |
#to_s ⇒ Object
146 147 148 |
# File 'lib/rushcheck/random.rb', line 146 def to_s @gen.to_s end |