Class: PlayStationNetwork::User
- Inherits:
-
Object
- Object
- PlayStationNetwork::User
- Defined in:
- lib/playstationnetwork/user.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #games ⇒ Object
-
#initialize(identity) ⇒ User
constructor
A new instance of User.
- #profile ⇒ Object
- #trophies(npcommid) ⇒ Object
Constructor Details
#initialize(identity) ⇒ User
Returns a new instance of User.
8 9 10 11 12 13 14 |
# File 'lib/playstationnetwork/user.rb', line 8 def initialize(identity) PlayStationNetwork::API.handle_response do raise ArgumentError, INVALID_IDENTITY_TYPE unless identity.is_a?(String) @options = PlayStationNetwork::API.request.merge(user_id: identity) end end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/playstationnetwork/user.rb', line 3 def @options end |
Instance Method Details
#games ⇒ Object
22 23 24 25 26 |
# File 'lib/playstationnetwork/user.rb', line 22 def games PlayStationNetwork::API.handle_response do PlayStationNetwork::API.parse_response('/psnGetUserGames', , 'games') end end |
#profile ⇒ Object
16 17 18 19 20 |
# File 'lib/playstationnetwork/user.rb', line 16 def profile PlayStationNetwork::API.handle_response do PlayStationNetwork::API.parse_response('/psnGetUser', ) end end |
#trophies(npcommid) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/playstationnetwork/user.rb', line 28 def trophies(npcommid) PlayStationNetwork::API.handle_response do raise INVALID_NPCOMMID_TYPE unless npcommid.is_a?(String) @options = .merge(npcommid: npcommid) PlayStationNetwork::API.parse_response('/psnGetUserTrophies', ) end end |