cartodb-4.42/spec/support/string_extension.rb

9 lines
163 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
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