Module: FatCore::String::ClassMethods
- Included in:
- String
- Defined in:
- lib/fat_core/string.rb
Generating collapse
-
#random(size = 8) ⇒ Object
Return a random string composed of all lower-case letters of length
size
.
Instance Method Details
permalink #random(size = 8) ⇒ Object
Return a random string composed of all lower-case letters of length
size
422 423 424 |
# File 'lib/fat_core/string.rb', line 422 def random(size = 8) ('a'..'z').cycle.take(size).shuffle.join end |