Class: PlayStationNetworkAPI::Game

Inherits:
Client
  • Object
show all
Defined in:
lib/play_station_network_api/game.rb

Instance Attribute Summary

Attributes inherited from Client

#account_id, #age, #country, #default_headers, #language, #refresh_token

Instance Method Summary collapse

Methods inherited from Client

#catalog, #entitlement, #explore, #game, #get_account_devices, #get_account_id, #initialize, #search, #session, #trophy, #user

Constructor Details

This class inherits a constructor from PlayStationNetworkAPI::Client

Instance Method Details

#games(offset: 0, limit: 10) ⇒ Object

COMMENT: Pretty much the same endpoint as [titles], except it gives a lot less data and there’s no conceptId information

offset [Integer] limit [Integer]

min: 1,
max: 300



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/play_station_network_api/game.rb', line 37

def games(offset: 0, limit: 10)
  raise 'limit must be less than or equal to 300' if limit > 300

  # https://m.np.playstation.net/api/gamelist/v3/users/6462910331343535058/profile/games?limit=300&offset=0
  get([path(version: 3), , 'profile', 'games'].join('/'),
    query: {
      offset: offset,
      limit: limit
    }
  ).parsed_response
end

#title(title_id) ⇒ Object

title_id [String]



24
25
26
27
# File 'lib/play_station_network_api/game.rb', line 24

def title(title_id)
  # https://m.np.playstation.net/api/gamelist/v2/users/6462910331343535058/titles/CUSA00938_00
  get([path, , 'titles', title_id].join('/')).parsed_response
end

#titles(offset: 0, limit: 10) ⇒ Object

offset [Integer] limit [Integer]

min: 1,
max: 300



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/play_station_network_api/game.rb', line 10

def titles(offset: 0, limit: 10)
  raise 'limit must be less than or equal to 300' if limit > 300

  # https://m.np.playstation.net/api/gamelist/v2/users/6462910331343535058/titles?limit=300&offset=0
  get([path, , 'titles'].join('/'),
    query: {
      offset: offset,
      limit: limit
    }
  ).parsed_response
end