class CLI

Public Instance Methods

call() click to toggle source
# File lib/50_best_restaurants/cli.rb, line 3
def call
  Scraper.new.make_restaurants
  puts "Welcome to the 50 Best Restaurants in the World"
  start
end
print_restaurant(restaurant) click to toggle source
print_restaurants(from_number) click to toggle source
start() click to toggle source
# File lib/50_best_restaurants/cli.rb, line 9
def start
  puts ""
  puts "What number restaurants would you like to see? 1-10, 11-20, 21-30, 31-40 or 41-50?"
  input = gets.strip.to_i

  print_restaurants(input)

  puts ""
  puts "What restaurant would you like more information on?"
  input = gets.strip

  restaurant = Restaurant.find(input.to_i)

  print_restaurant(restaurant)

  puts ""
  puts "Would you like to see another restaurant? Enter Y or N"

  input = gets.strip.downcase
  if input == "y"
    start
  else
    puts ""
    puts "Thankyou! Have a great day!"
    exit
  end    
end