Module: Gamerom::RepoAdapter

Overview

RepoAdapter - Common adapter methods

Instance Method Summary collapse

Instance Method Details

#games(platform) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/gamerom/repo_adapter.rb', line 13

def games(platform)
  games = []
  progress_bar = ProgressBar.new(platform, sections.count)

  extract_games(platform) do |section_games, section_index|
    games.append(*section_games)
    progress_bar.set(section_index + 1)
  end

  progress_bar.finish
  games
end

#nokogiri_get(url) ⇒ Object



9
10
11
# File 'lib/gamerom/repo_adapter.rb', line 9

def nokogiri_get(url)
  Nokogiri::HTML(RestClient.get(url))
end