Sha256: d2281fe3e01dbaa21ae3d96e91cf96a25049a1f4837d36172e8d016f521ceb60
Contents?: true
Size: 498 Bytes
Versions: 13
Compression:
Stored size: 498 Bytes
Contents
class String def unindent gsub(/^\s*/,'') end def unindent! gsub!(/^\s*/,'') end def self.random_char case random_digit = rand(62) when 0...10 : random_digit.to_s when 10...36 : (random_digit + 55).chr when 36...62 : (random_digit + 61).chr end end def self.random(length_of_string=8) Array.new(length_of_string) { random_char }.join end def nameify() downcase.gsub(/[^\w]/, '') end def nameify!() replace nameify end end
Version data entries
13 entries across 13 versions & 7 rubygems