14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/stock_info/cli.rb', line 14
def
input = nil
while input != 'exit'
puts 'Enter the ticker symbol of a stock you would like more info on.'
puts "Other commands: 'exit' - exits stock-info, 'trending' - refresh trending stocks."
input = gets.strip.downcase
if input == 'trending'
trending_tickers
elsif StockInfo::Stock.check_symbol(input.upcase) == true
stock = StockInfo::Stock.create_or_return(input.upcase)
stock.print_info
puts 'View recent news articles related to this stock? (yes/no)'
news_bool = gets.strip[0].downcase
input = StockInfo::News.(stock) if news_bool == 'y'
elsif input != 'exit'
puts 'Please input a command or ticker symbol'
end
end
end
|