Module: StringUtility
Class Method Summary collapse
-
.random_line(path) ⇒ String
Gets a random line in a file.
Class Method Details
.random_line(path) ⇒ String
Gets a random line in a file.
52 53 54 55 |
# File 'lib/utils.rb', line 52 def self.random_line(path) read = File.readlines(path) read[rand(read.size)] end |