class NytimesTopStories::CLI

Public Instance Methods

call() click to toggle source
# File lib/nytimes_top_stories/cli.rb, line 2
def call
  puts NytimesTopStories::Scraper.get_date
  puts "Headlines live from NYT:"
  self.display_stories
  self.menu
  self.goodbye
end
display_stories() click to toggle source
# File lib/nytimes_top_stories/cli.rb, line 10
def display_stories
  NytimesTopStories::Story.new_from_array
  NytimesTopStories::Story.all.each.with_index(1) {|story, i| puts "#{i}: #{story.headline}"}
end
goodbye() click to toggle source
# File lib/nytimes_top_stories/cli.rb, line 33
def goodbye
  puts "The truth is more important now than ever."
  exit(0)
end
menu() click to toggle source