cartodb/spec/support/string_extension.rb
2020-06-15 10:58:47 +08:00

9 lines
163 B
Ruby

class String
@@chars ||= ('a'..'z').to_a + ('A'..'Z').to_a
def self.random(size = 8)
(0..size).map{ @@chars[rand(@@chars.length)] }.join
end
end