class Bestsellers::CLI

Public Instance Methods

byebye() click to toggle source
# File lib/bestsellers/cli.rb, line 58
def byebye
    puts " "
    puts "Thank you for visiting Bestsellers! Enjoy reading your new book!"
end
call() click to toggle source
# File lib/bestsellers/cli.rb, line 3
def call
    Bestsellers::Scraper.create_bestsellers
    welcome
    list_books
    puts " "
    menu_selection
    byebye
end
list_books() click to toggle source
# File lib/bestsellers/cli.rb, line 27
def list_books
    @bestseller_books = Bestsellers::Books.all
    @bestseller_books.each.with_index(1) do |book, index|
        puts "#{index}. #{book.title}"
    end
end
menu_selection() click to toggle source
welcome() click to toggle source
# File lib/bestsellers/cli.rb, line 12
    def welcome
        puts <<-GREETING
        
        ██████╗ ███████╗███████╗████████╗███████╗███████╗██╗     ██╗     ███████╗██████╗ ███████╗
        ██╔══██╗██╔════╝██╔════╝╚══██╔══╝██╔════╝██╔════╝██║     ██║     ██╔════╝██╔══██╗██╔════╝
        ██████╔╝█████╗  ███████╗   ██║   ███████╗█████╗  ██║     ██║     █████╗  ██████╔╝███████╗
        ██╔══██╗██╔══╝  ╚════██║   ██║   ╚════██║██╔══╝  ██║     ██║     ██╔══╝  ██╔══██╗╚════██║
        ██████╔╝███████╗███████║   ██║   ███████║███████╗███████╗███████╗███████╗██║  ██║███████║
        ╚═════╝ ╚══════╝╚══════╝   ╚═╝   ╚══════╝╚══════╝╚══════╝╚══════╝╚══════╝╚═╝  ╚═╝╚══════╝
                                The Best Selling Books You Must Read!
        ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

        GREETING
    end