class CLI
Public Instance Methods
list_stories()
click to toggle source
# File lib/NBA_news/cli.rb, line 14 def list_stories Story.all.each_with_index do |story, i| puts "#{i+1}) #{story.title.colorize(:blue)} By: #{story.author}" end end
run()
click to toggle source
# File lib/NBA_news/cli.rb, line 3 def run puts "Welcome to NBA News! Here are the latest stories around the league:".colorize(:yellow) sleep 1 Scraper.scrape list_stories sleep 1 puts "Would you like to read a story? [y/n]".colorize(:yellow) menu end