playstationnetwork-api 1.0.1 → 1.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 430864a191a11e21a0803925dfed8482a0220c83
4
- data.tar.gz: 699f46b3ca2c0920da2b0ee49fe8224e47ba5b6f
3
+ metadata.gz: 76fa898f39d77d8b85920db372efd5157d2cf590
4
+ data.tar.gz: 5ce19e4071db0d20a02ab7a9fda1b22fd5085f09
5
5
  SHA512:
6
- metadata.gz: 1f3ba6d4bb76fccfe830a150e4841e02023aae97fc27ec8da20fe7cf155869fb9230a99d4efaf1f77b054da17782c9ec96994250050b1d8e16f4d055f90fdb2e
7
- data.tar.gz: dd83fdb3ff75aa7cbde161518f0f92d24321f68d4eaaaa694e186ff69ef4f290a07bf4e22ff6901c106c67e1a8f5a38e53d72c22efbd34a4afecf1779b556308
6
+ metadata.gz: 63720efb6eaa630bba77fd731004ceb028a747666a25a1ca11fd1e0df40c98ff8fde58a9252960acf556de1c4cb5e7d793b13447ddabcc748dae305223550c34
7
+ data.tar.gz: 34735743f07ca2b51d84cb3dac38e26d1a2377634340566dddd31ddb2134da3381e24f8bd8fc4a7d045951c6c662ab95802ebebde9381df2d212adad2bcf56f0
@@ -6,11 +6,9 @@ module PlayStationNetwork
6
6
 
7
7
  def self.config
8
8
  {
9
- body: {
10
- api_key: '4047cc6b66393a82a0c7d90844cf0d88b14e0c3a',
11
- api_secret: 'pacMakaveli90',
12
- response_type: 'json'
13
- }
9
+ api_key: '4047cc6b66393a82a0c7d90844cf0d88b14e0c3a',
10
+ api_secret: 'pacMakaveli90',
11
+ response_type: 'json'
14
12
  }
15
13
  end
16
14
  end
@@ -55,8 +55,8 @@ module PlayStationNetwork
55
55
  end
56
56
 
57
57
  def self.find(psn_game_id)
58
- response = PlayStationNetwork::API.post("/psnGetGame",
59
- PlayStationNetwork::API.config[:body].merge({ npcommid: psn_game_id }))
58
+ options = PlayStationNetwork::API.config.merge({ npcommid: psn_game_id })
59
+ response = PlayStationNetwork::API.post('/psnGetGame', body: options)
60
60
 
61
61
  if response.success?
62
62
  parsed = JSON.parse(response)
@@ -22,8 +22,8 @@ module PlayStationNetwork
22
22
  # => ps4 returns all PS4 games
23
23
  #
24
24
  def self.all(psn_platform = 'all')
25
- response = PlayStationNetwork::API.post('/psnListGames',
26
- PlayStationNetwork::API.config[:body].merge({ platform: psn_platform }))
25
+ options = PlayStationNetwork::API.config.merge({ platform: psn_platform })
26
+ response = PlayStationNetwork::API.post('/psnListGames', body: options)
27
27
 
28
28
  sanitized_response = response.gsub('<?xml version=\"1.0\"?>', '').gsub('<\/', '</').tr('"', '')
29
29
  parsed_response = Hash.from_xml(sanitized_response)
@@ -12,8 +12,8 @@ module PlayStationNetwork
12
12
  end
13
13
 
14
14
  def self.all(psn_game_id)
15
- response = PlayStationNetwork::API.post('/psnGetTrophies',
16
- PlayStationNetwork::API.config[:body].merge({ npcommid: psn_game_id }))
15
+ options = PlayStationNetwork::API.config.merge({ npcommid: psn_game_id })
16
+ response = PlayStationNetwork::API.post('/psnGetTrophies', body: options)
17
17
 
18
18
  if response.success?
19
19
  parsed = JSON.parse(response)
@@ -10,8 +10,8 @@ module PlayStationNetwork
10
10
  end
11
11
 
12
12
  def self.all(psn_user_id)
13
- response = PlayStationNetwork::API.post('/psnGetUserGames',
14
- PlayStationNetwork::API.config[:body].merge({ user_id: psn_user_id }))
13
+ options = PlayStationNetwork::API.config.merge({ user_id: psn_user_id })
14
+ response = PlayStationNetwork::API.post('/psnGetUserGames', body: options)
15
15
 
16
16
  if response.success?
17
17
  parsed = JSON.parse(response)
@@ -9,9 +9,9 @@ module PlayStationNetwork
9
9
  end
10
10
 
11
11
  def self.all(psn_user_id, psn_game_id)
12
- response = PlayStationNetwork::API.post('/psnGetUserTrophies',
13
- PlayStationNetwork::API.config[:body].merge({ user_id: psn_user_id, npcommid: psn_game_id }))
14
-
12
+ options = PlayStationNetwork::API.config.merge({ user_id: psn_user_id, npcommid: psn_game_id })
13
+ response = PlayStationNetwork::API.post('/psnGetUserTrophies', body: options)
14
+
15
15
  if response.success?
16
16
  parsed = JSON.parse(response)
17
17
 
@@ -73,8 +73,8 @@ module PlayStationNetwork
73
73
  end
74
74
 
75
75
  def self.profile(psn_user_id)
76
- response = PlayStationNetwork::API.post('/psnGetUser',
77
- PlayStationNetwork::API.config[:body].merge({ user_id: psn_user_id }))
76
+ options = PlayStationNetwork::API.config.merge({ user_id: psn_user_id })
77
+ response = PlayStationNetwork::API.post('/psnGetUser', body: options)
78
78
 
79
79
  if response.success?
80
80
  parsed = JSON.parse(response)
@@ -1,5 +1,5 @@
1
1
  module PlayStationNetwork
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
 
4
4
  # Changelog
5
5
  #
@@ -17,4 +17,5 @@ module PlayStationNetwork
17
17
  # it's basically a new gem
18
18
  # v1.0.1 - Fixes a bug where activesupport version would cause an issue with existing
19
19
  # rails apps
20
+ # v1.0.2 - Adds correct hash format to pass the api key and secret to each route
20
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playstationnetwork-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlad Radulescu