12
13
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 12
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' - shows trending stocks."
input = gets.strip.downcase
if input == 'trending'
trending_tickers
elsif StockInfo::Stock.check_symbol(input.upcase) == true
stock = StockInfo::Stock.new(input.upcase)
stock.print_info
puts "View recent news articles related to this stock? (yes/no)"
news_bool = gets.strip[0].downcase
if news_bool == 'y'
StockInfo::Stock::News.(stock)
end
elsif input != 'exit'
puts 'Please input a command or ticker symbol'
end
end
end
|