class BestPizza::CLI

Public Instance Methods

call() click to toggle source
# File lib/best_pizza/cli.rb, line 3
def call
        BestPizza::Restaurant.scrape_pizza
        list_pizza
        menu
end
list_pizza() click to toggle source
# File lib/best_pizza/cli.rb, line 9
def list_pizza
        puts ""
        puts "================================================="
        puts "               Best New York Pizza "
        puts "================================================="
        @pizzas = BestPizza::Restaurant.pizza_restaurants
        @pizzas.each.with_index(1) do |pizza, i|
                puts "#{i}. #{pizza.name}"   
        end
        puts "-------------------------------------------------"
end
menu() click to toggle source
repeat() click to toggle source
# File lib/best_pizza/cli.rb, line 51
def repeat
        puts ""
        puts "Would you like to see another restaurant? Enter Y or N"
        input = gets.strip.downcase
        if input == "y"
                list_pizza
        else
                thanks
        end
end
thanks() click to toggle source
# File lib/best_pizza/cli.rb, line 62
def thanks 
        puts "Thanks! Enjoy your pizza!"
        exit
end