class QuoteImporter
Public Class Methods
new()
click to toggle source
# File lib/rack/quote_importer.rb, line 2 def initialize @quotes = [] Dir.glob('fixtures/*.txt').each do |file| f = File.open(file) f.each_line do |line| @quotes << line.chomp end end end
Public Instance Methods
random()
click to toggle source
# File lib/rack/quote_importer.rb, line 12 def random @quotes.shuffle.first end