Class: CLI
- Inherits:
-
Object
- Object
- CLI
- Defined in:
- lib/makeup_maker/cli.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
3 4 5 6 |
# File 'lib/makeup_maker/cli.rb', line 3 def call list_makers end |
#goodbye ⇒ Object
37 38 39 |
# File 'lib/makeup_maker/cli.rb', line 37 def goodbye puts "That's all the info I have! Hope it was helpful!" end |
#list_makers ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/makeup_maker/cli.rb', line 8 def list_makers puts "Makeup Manufacturers: USA" @makers = Scraper.name @makers.each.with_index(1) do |makers, i| puts "#{i}. #{makers}" end end |
#menu ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/makeup_maker/cli.rb', line 17 def @the_makers = Scraper.scrape_info input = nil while input != "exit" puts "Enter the number of the manufacturer you would like more info on or type exit to leave: " input = gets.strip.downcase if input.to_i > 0 makers = @the_makers[input.to_i - 1] puts "Stock Name:" + " #{makers.stock_name}" puts "Stock Price:"+ " $#{makers.stock_price}" puts "Location:" + " #{makers.location}" puts "URL:" + " #{makers.url}" puts "Corporate Info:" + " #{makers.corp_info}" elsif input != "exit" puts "Invalid entry. Please enter a number or exit." end end goodbye end |