Module: GamesRadarApi::Client::Games

Included in:
GamesRadarApi::Client
Defined in:
lib/games_radar_api/client/games.rb

Instance Method Summary collapse

Instance Method Details

#game(id) ⇒ Object



10
11
12
13
14
15
# File 'lib/games_radar_api/client/games.rb', line 10

def game(id)
  response = get("/game/#{id}")
  self.total_rows = response.total_rows.to_i
  return response.game unless response.game.id.nil?
  return nil
end

#game_search(query, platform, options = {:region=>'us'}) ⇒ Object



17
18
19
20
21
# File 'lib/games_radar_api/client/games.rb', line 17

def game_search(query,platform,options={:region=>'us'})
  response = get("/search/gameName/#{platform}/#{query}",options)
  self.total_rows = response.games.total_rows.to_i
  response.games.game
end

#games(options = {:platform=>'all',:genre=>'all',:page_num=>1,:page_size=>10,:sort=>'newest'}) ⇒ Object



4
5
6
7
8
# File 'lib/games_radar_api/client/games.rb', line 4

def games(options={:platform=>'all',:genre=>'all',:page_num=>1,:page_size=>10,:sort=>'newest'})
   response = get('/games',options)
   self.total_rows = response.games.total_rows.to_i
   response.games.game
end