Class: PlayStationNetwork::User

Inherits:
API
  • Object
show all
Defined in:
lib/playstationnetwork/user.rb

Instance Attribute Summary

Attributes inherited from API

#config, #options

Instance Method Summary collapse

Methods inherited from API

#post

Constructor Details

#initialize(identity) ⇒ User

Returns a new instance of User.

Raises:

  • (INVALID_IDENTITY_TYPE)


6
7
8
9
10
11
# File 'lib/playstationnetwork/user.rb', line 6

def initialize(identity)
  raise INVALID_IDENTITY_TYPE unless identity.is_a?(String)

  super
  options[:user_id] = identity
end

Instance Method Details

#games(dig_to: ['games']) ⇒ Object



17
18
19
# File 'lib/playstationnetwork/user.rb', line 17

def games(dig_to: ['games'])
  post('/psnGetUserGames', dig_to: dig_to)
end

#profileObject



13
14
15
# File 'lib/playstationnetwork/user.rb', line 13

def profile
  post('/psnGetUser')
end

#trophies(npcommid, dig_to: ['trophies']) ⇒ Object

Raises:

  • (INVALID_IDENTITY_TYPE)


21
22
23
24
25
26
# File 'lib/playstationnetwork/user.rb', line 21

def trophies(npcommid, dig_to: ['trophies'])
  raise INVALID_IDENTITY_TYPE unless npcommid.is_a?(String)

  options[:npcommid] = npcommid
  post('/psnGetUserTrophies', dig_to: dig_to)
end