Class: Vapor::Crawler

Inherits:
Object
  • Object
show all
Defined in:
lib/vapor/crawler.rb

Instance Method Summary collapse

Instance Method Details

#games_for(user) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/vapor/crawler.rb', line 4

def games_for(user)
  doc = fetch("#{user.profile_url}games")
  doc.gamesList.games.elements
rescue NoMethodError => e
  if doc.gamesList.error.text =~ /profile is private/
    raise UserPrivateError, user.steam_id
  end
  raise e
end