Method: Caboose.random_string
- Defined in:
- lib/caboose/engine.rb
.random_string(length) ⇒ Object
69 70 71 72 |
# File 'lib/caboose/engine.rb', line 69 def Caboose.random_string(length) o = [('a'..'z'),('A'..'Z'),('0'..'9')].map { |i| i.to_a }.flatten return (0...length).map { o[rand(o.length)] }.join end |