class PlayStationNetwork::Game
Public Class Methods
new(npcommid = '')
click to toggle source
Calls superclass method
PlayStationNetwork::API::new
# File lib/playstationnetwork/game.rb, line 9 def initialize(npcommid = '') raise INVALID_NPCOMMID_TYPE unless npcommid.is_a?(String) super unless npcommid.empty? options[:npcommid] = npcommid end end
Public Instance Methods
all(platform: 'all', popular: false)
click to toggle source
# File lib/playstationnetwork/game.rb, line 26 def all(platform: 'all', popular: false) raise INVALID_PLATFORM_TYPE unless platform.is_a?(String) raise INVALID_PLATFORM_TYPE unless GAMES_PARAMETERS_TYPES.include?(platform) raise INVALID_POPULAR_TYPE unless popular.is_a?(FalseClass) || popular.is_a?(TrueClass) if popular options[:list] = platform url = '/psnPopularThisWeek' else options[:platform] = platform url = '/psnListGames' end post(url, dig_to: ['psn_api', 'game'], xml: true) end
details()
click to toggle source
# File lib/playstationnetwork/game.rb, line 18 def details post('/psnGetGame') end
trophies()
click to toggle source
# File lib/playstationnetwork/game.rb, line 22 def trophies post('/psnGetTrophies') end