class Markets::CLI

Public Instance Methods

call() click to toggle source
# File lib/markets/cli.rb, line 5
def call
  list_stories
  menu
end
end_program() click to toggle source
# File lib/markets/cli.rb, line 49
def end_program
  puts "Thank you for using the Markets gem, come back soon!"
end
list_stories() click to toggle source
# File lib/markets/cli.rb, line 10
def list_stories
  puts "\e[H\e[2J"
  puts "Here's the latest finance news from The Atlantic: "
  puts ""
  @story_items = Markets::News.create_stories
  @story_items.each.with_index(1) do |story, i|
    puts "\t#{i}. #{story.title}\n"
    puts " "
    puts "\tPublished on #{story.date.first}\tWritten by #{story.author}\n"
    puts " "
  end
end
menu() click to toggle source