Class: SecureYOLORNG
- Inherits:
-
Object
- Object
- SecureYOLORNG
- Defined in:
- lib/syolorng.rb
Class Method Summary collapse
-
.rand(max = nil) ⇒ Object
Return a random integer.
Class Method Details
.rand(max = nil) ⇒ Object
Return a random integer
Example:
>> SecureYOLORNG.rand
=> 1263245525397660367831872 # Hey! That IS totally random!
>> SecureYOLORNG.rand 10
=> 9
Arguments:
max: (Integer)
18 19 20 21 22 23 24 25 |
# File 'lib/syolorng.rb', line 18 def self.rand(max=nil) case max when nil random else random % max end end |