# File lib/rantly/generator.rb, line 276 def string(char_class=:print) chars = case char_class when Regexp Chars.of(char_class) when Symbol Chars::CLASSES[char_class] end raise "bad arg" unless chars char_strings = chars.map { |c| c.chr } str = Array.new(size) current_index = 0 while current_index < size str[current_index] = char_strings.sample current_index += 1 end str.join end