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
#random(size = 8) ⇒ Object
Return a random string composed of all lower-case letters of length
size
414 415 416 |
# File 'lib/fat_core/string.rb', line 414 def random(size = 8) ('a'..'z').cycle.take(size).shuffle.join end |