Module: RandomUtil
- Defined in:
- lib/random_util.rb,
lib/random_util/version.rb
Constant Summary collapse
- ALPHABETS =
('a'..'z').to_a + ('A'..'Z').to_a
- NUMBERS =
(0..9).to_a
- VERSION =
"0.0.6"
Class Method Summary collapse
Class Method Details
.alphabet_and_number(counts) ⇒ Object
15 16 17 18 |
# File 'lib/random_util.rb', line 15 def self.alphabet_and_number(counts) symbols = ALPHABETS + NUMBERS Array.new(counts).map { symbols.sample }.join end |
.alphabets(counts) ⇒ Object
7 8 9 |
# File 'lib/random_util.rb', line 7 def self.alphabets(counts) Array.new(counts).map { ALPHABETS.sample }.join end |
.numbers(counts) ⇒ Object
11 12 13 |
# File 'lib/random_util.rb', line 11 def self.numbers(counts) Array.new(counts).map { NUMBERS.sample }.join end |