playstationnetwork-api 2.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/playstationnetwork/api.rb +7 -3
- data/lib/playstationnetwork/game.rb +2 -2
- data/lib/playstationnetwork/user.rb +3 -3
- data/lib/playstationnetwork/version.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82391e1f2a2c4a615715c7c8f339a5031b1d6f5c
|
4
|
+
data.tar.gz: ea165570702a890daf8efccadc0d7db68db1badc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1000db4ca3aca7e1415bfccc2266d3e4e7cab8a8c3fd2e727c12d7dc8e191241c200b873efa2e9eab88267259adb24ba54aad0a03d5d94918d8640ee8317d758
|
7
|
+
data.tar.gz: 2595edff1d55dcc9fe18dd25b498c551c1f6af644da25b81ae85bed5efa62461c7f297c6bceddde2a2dc012315e4ff8e248c804f00450e546b52643551ce873c
|
@@ -61,12 +61,16 @@ module PlayStationNetwork
|
|
61
61
|
}
|
62
62
|
end
|
63
63
|
|
64
|
-
def parse_response(url,
|
65
|
-
request = post(url, body)
|
64
|
+
def parse_response(url, options, reduce_to = {})
|
65
|
+
request = post(url, body: options)
|
66
66
|
|
67
67
|
if request.success?
|
68
68
|
begin
|
69
|
-
|
69
|
+
if reduce_to.blank?
|
70
|
+
JSON.parse(request)
|
71
|
+
else
|
72
|
+
JSON.parse(request)[reduce_to]
|
73
|
+
end
|
70
74
|
rescue
|
71
75
|
raise "There was a problem parsing the JSON. Most likely an API problem."
|
72
76
|
end
|
@@ -23,13 +23,13 @@ module PlayStationNetwork
|
|
23
23
|
|
24
24
|
def details
|
25
25
|
PlayStationNetwork::API.handle_response do
|
26
|
-
PlayStationNetwork::API.parse_response('/psnGetGame',
|
26
|
+
PlayStationNetwork::API.parse_response('/psnGetGame', options)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
def trophies
|
31
31
|
PlayStationNetwork::API.handle_response do
|
32
|
-
PlayStationNetwork::API.parse_response('/psnGetTrophies',
|
32
|
+
PlayStationNetwork::API.parse_response('/psnGetTrophies', options)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -15,13 +15,13 @@ module PlayStationNetwork
|
|
15
15
|
|
16
16
|
def profile
|
17
17
|
PlayStationNetwork::API.handle_response do
|
18
|
-
PlayStationNetwork::API.parse_response('/psnGetUser',
|
18
|
+
PlayStationNetwork::API.parse_response('/psnGetUser', options)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
22
|
def games
|
23
23
|
PlayStationNetwork::API.handle_response do
|
24
|
-
PlayStationNetwork::API.parse_response('/psnGetUserGames',
|
24
|
+
PlayStationNetwork::API.parse_response('/psnGetUserGames', options, 'games')
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -30,7 +30,7 @@ module PlayStationNetwork
|
|
30
30
|
raise INVALID_NPCOMMID_TYPE unless npcommid.is_a?(String)
|
31
31
|
|
32
32
|
@options = options.merge(npcommid: npcommid)
|
33
|
-
PlayStationNetwork::API.parse_response('/psnGetUserTrophies',
|
33
|
+
PlayStationNetwork::API.parse_response('/psnGetUserTrophies', options)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module PlayStationNetwork
|
2
|
-
VERSION ||= '2.0'
|
2
|
+
VERSION ||= '2.0.1'
|
3
3
|
|
4
4
|
def self.changelog
|
5
5
|
puts "
|
@@ -38,6 +38,9 @@ module PlayStationNetwork
|
|
38
38
|
Trophies: ::G::Trophies.all('NPWR00132_00') -> ::Game.new('NPWR00132_00').trophies
|
39
39
|
All: ::G::Games.all('all') -> ::Game.new().all(platform: 'ps4') # default 'all'
|
40
40
|
Popular: ::G::Games.popular() -> ::Game.new().all(popular: true)
|
41
|
+
|
42
|
+
v2.0.1
|
43
|
+
- When requesting Games for a specific user, return only the games instead of a full response which returns the same data that ::User.new('pacMakaveli90').profile already returns
|
41
44
|
"
|
42
45
|
end
|
43
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playstationnetwork-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vlad Radulescu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|