Class: PlayStationNetwork::Games
- Inherits:
-
Object
- Object
- PlayStationNetwork::Games
- Defined in:
- lib/playstationnetwork/games.rb
Instance Attribute Summary collapse
-
#games ⇒ Object
Returns the value of attribute games.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#total_games ⇒ Object
Returns the value of attribute total_games.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(total_games, offset, limit, games) ⇒ Games
constructor
A new instance of Games.
Constructor Details
#initialize(total_games, offset, limit, games) ⇒ Games
Returns a new instance of Games.
5 6 7 8 9 10 |
# File 'lib/playstationnetwork/games.rb', line 5 def initialize(total_games, offset, limit, games) self.total_games = total_games self.offset = offset self.limit = limit self.games = games end |
Instance Attribute Details
#games ⇒ Object
Returns the value of attribute games.
3 4 5 |
# File 'lib/playstationnetwork/games.rb', line 3 def games @games end |
#limit ⇒ Object
Returns the value of attribute limit.
3 4 5 |
# File 'lib/playstationnetwork/games.rb', line 3 def limit @limit end |
#offset ⇒ Object
Returns the value of attribute offset.
3 4 5 |
# File 'lib/playstationnetwork/games.rb', line 3 def offset @offset end |
#total_games ⇒ Object
Returns the value of attribute total_games.
3 4 5 |
# File 'lib/playstationnetwork/games.rb', line 3 def total_games @total_games end |
Class Method Details
.find(username, offset = 0) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/playstationnetwork/games.rb', line 12 def self.find(username, offset = 0) response = PlayStationNetwork::API.get("/#{username}/trophies/o/#{offset}") if response.success? new( response['totalResults'], response['offset'], response['limit'], response['trophyTitles'] ) else raise response.response end end |