Class: BggHotnessCLI::CLI
- Inherits:
-
Object
- Object
- BggHotnessCLI::CLI
- Defined in:
- lib/bgg-hotness-cli/cli.rb
Class Method Summary collapse
-
.goodbye ⇒ Object
Displays goodbye and ends program.
- .header ⇒ Object
-
.run ⇒ Object
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.
Class Method Details
.goodbye ⇒ Object
Displays goodbye and ends program
3 4 5 6 7 8 |
# File 'lib/bgg-hotness-cli/cli.rb', line 3 def self.goodbye puts puts "Goodbye!" puts return end |
.header ⇒ Object
10 11 12 13 14 |
# File 'lib/bgg-hotness-cli/cli.rb', line 10 def self.header puts "\e[H\e[2J" puts puts "BGG Hotness CLI" end |
.run ⇒ Object
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.
19 20 21 22 23 24 25 26 27 28 |
# 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 |