playstationnetwork-api 0.0.3 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d979f78c62a903d0528298317aad855b6de235a
4
- data.tar.gz: 342f58da671803ab693cdd9888050a623d1e0a9f
3
+ metadata.gz: b351e27faebd09b7f6bc892b4d1fc40695215fce
4
+ data.tar.gz: a6ddc6114a636d2807d96046fd0f2f31a4ecd6d1
5
5
  SHA512:
6
- metadata.gz: 65332e8c97ff720475ddcf1ca706904ebca7f27e9f3592870321e91b487313e4a533f7fd3c7204d041c0d8bcef483ef6085ccdadab5b0863c9bf1af9dde088d1
7
- data.tar.gz: 3bb73e58a0ea73711bd2ffb5a6ed042d1810c48204a75a85299edc7a11566675505af9602b5a529ccfe5d0fb37d414e23b6771e54971fdab46cc397368c3772e
6
+ metadata.gz: 50ddf55978fdac5795b0659dadef194ae8fa432f6eeef224b91d25591ee86108167be7dd6120c9ab1e3a36d76bbe6b4ec3b004aa8a42d59232d817dde1f5e93b
7
+ data.tar.gz: 120f05a6ed7c9307a3d6cc89fbffba0fb8266a86626e4b7e7def000b67b09c9b506aeeb068199c03a79e1df225ca5685f6a8447aac15b24cc3f0b57c7f5f20cc
@@ -1,6 +1,6 @@
1
1
  module PlayStationNetwork
2
2
 
3
- class Trophy
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,6 +1,6 @@
1
1
  module PlayStationNetwork
2
2
 
3
- class TrophyGroup
3
+ class TrophyGroups
4
4
  attr_accessor :psn_id, :groups #:group_id, :name, :description, :cover, :defined_trophies
5
5
 
6
6
  def initialize(psn_id, groups) # group_id, name, description, cover, defined_trophies)
@@ -1,9 +1,13 @@
1
1
  module PlayStationNetwork
2
- VERSION = '0.0.3'
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.0.3
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-21 00:00:00.000000000 Z
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/trophy.rb
90
- - lib/playstationnetwork/trophy_group.rb
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