playstationnetwork-api 0.0.3 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b351e27faebd09b7f6bc892b4d1fc40695215fce
|
4
|
+
data.tar.gz: a6ddc6114a636d2807d96046fd0f2f31a4ecd6d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50ddf55978fdac5795b0659dadef194ae8fa432f6eeef224b91d25591ee86108167be7dd6120c9ab1e3a36d76bbe6b4ec3b004aa8a42d59232d817dde1f5e93b
|
7
|
+
data.tar.gz: 120f05a6ed7c9307a3d6cc89fbffba0fb8266a86626e4b7e7def000b67b09c9b506aeeb068199c03a79e1df225ca5685f6a8447aac15b24cc3f0b57c7f5f20cc
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module PlayStationNetwork
|
2
2
|
|
3
|
-
class
|
3
|
+
class Trophies
|
4
4
|
attr_accessor :psn_id, :group_id, :trophies #, :trophy_id, :hidden, :type, :name, :description, :cover, :rarity, :earned_rate
|
5
5
|
|
6
6
|
def initialize(psn_id, group_id, trophies)# trophy_id, hidden, type, name, description, cover, rarity, earned_rate)
|
@@ -38,5 +38,27 @@ module PlayStationNetwork
|
|
38
38
|
raise response.response
|
39
39
|
end
|
40
40
|
end
|
41
|
+
|
42
|
+
def self.all(username, game_id)
|
43
|
+
response = PlayStationNetwork::API.get("/#{username}/trophies/#{game_id}")
|
44
|
+
|
45
|
+
if response.success?
|
46
|
+
new(
|
47
|
+
game_id,
|
48
|
+
nil,
|
49
|
+
response['trophies']
|
50
|
+
# response['trophyId'],
|
51
|
+
# response['trophyHidden'],
|
52
|
+
# response['trophyType'],
|
53
|
+
# response['trophyName'],
|
54
|
+
# response['trophyDetail'],
|
55
|
+
# response['trophyIconUrl'],
|
56
|
+
# response['trophyRare'],
|
57
|
+
# response['trophyEarnedRate']
|
58
|
+
)
|
59
|
+
else
|
60
|
+
raise response.response
|
61
|
+
end
|
62
|
+
end
|
41
63
|
end
|
42
64
|
end
|
@@ -1,9 +1,13 @@
|
|
1
1
|
module PlayStationNetwork
|
2
|
-
VERSION = '0.
|
2
|
+
VERSION = '0.1.1'
|
3
3
|
|
4
4
|
# Changelog
|
5
5
|
#
|
6
6
|
# v0.0.1 - Initial
|
7
7
|
# v0.0.2 - Added Trophy Information
|
8
8
|
# v0.0.3 - Added Trophies offset
|
9
|
+
# v0.1.0 - Pluralized Renamed Trophy and TrophyGroup classes
|
10
|
+
# v0.1.1 - Added a convenient method 'all' on Trophies, without having to pass
|
11
|
+
# the group id as an argument
|
12
|
+
|
9
13
|
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: 0.
|
4
|
+
version: 0.1.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: 2016-04-
|
11
|
+
date: 2016-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -86,8 +86,8 @@ files:
|
|
86
86
|
- lib/playstationnetwork/api.rb
|
87
87
|
- lib/playstationnetwork/games.rb
|
88
88
|
- lib/playstationnetwork/profile.rb
|
89
|
-
- lib/playstationnetwork/
|
90
|
-
- lib/playstationnetwork/
|
89
|
+
- lib/playstationnetwork/trophies.rb
|
90
|
+
- lib/playstationnetwork/trophy_groups.rb
|
91
91
|
- lib/playstationnetwork/version.rb
|
92
92
|
- playstationnetwork-api.gemspec
|
93
93
|
- spec/playstationnetwork/api_spec.rb
|