class BggHotnessCLI::CLI

Public Class Methods

goodbye() click to toggle source

Displays goodbye and ends program

# File lib/bgg-hotness-cli/cli.rb, line 3
def self.goodbye
  puts
  puts "Goodbye!"
  puts
  return
end
header() click to toggle source
# File lib/bgg-hotness-cli/cli.rb, line 10
def self.header
  puts "\e[H\e[2J"
  puts 
  puts "BGG Hotness CLI"
end
run() click to toggle source

Runs program by creating empty pages, doing a scrape of the hot list, adding games to pages, and printing the first 10 items on the list.

# File lib/bgg-hotness-cli/cli.rb, line 19
def self.run
  # Create empty pages
  BggHotnessCLI::Page.make_pages

  # Scrape list, which creates game instances
  # and adds them to their pages in order.
  BggHotnessCLI::Scraper.new("https://www.boardgamegeek.com/xmlapi2/hot?boardgame").game_list
  
  BggHotnessCLI::Page.all[0].display_page
end