Class: DocFrac::Utilities

Inherits:
Object
  • Object
show all
Defined in:
lib/doc_frac/utilities.rb

Class Method Summary collapse

Class Method Details

.random_string(length = 10) ⇒ Object



3
4
5
6
7
8
# File 'lib/doc_frac/utilities.rb', line 3

def self.random_string(length=10)
  string   = ''
  chars    = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ123456789'
  length.times { |i| string << chars[rand(chars.length)] }
  string
end