class DontThink::Source
Your code goes hereā¦
Public Instance Methods
content()
click to toggle source
# File lib/dont_think.rb, line 10 def content File.read path end
load_sentences()
click to toggle source
# File lib/dont_think.rb, line 18 def load_sentences content.split("\n").reject {|s| s.empty? || s.nil? } end
path()
click to toggle source
# File lib/dont_think.rb, line 6 def path File.expand_path('data/source.txt') end
random_sentence()
click to toggle source
# File lib/dont_think.rb, line 22 def random_sentence sentences.sample end
sentences()
click to toggle source
# File lib/dont_think.rb, line 14 def sentences @sentences ||= load_sentences end