Class: Steam::Game
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
#attribute_names, #attributes, #inspect
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/steam/game.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/steam/game.rb', line 8 def name @name end |
#profile ⇒ Object (readonly)
Returns the value of attribute profile.
8 9 10 |
# File 'lib/steam/game.rb', line 8 def profile @profile end |
Class Method Details
.find_all(profile, options = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/steam/game.rb', line 29 def find_all profile, = {} base_uri profile.url data = get '/games', if data['gamesList'] && data['gamesList']['games'] && data['gamesList']['games']['game'] data['gamesList']['games']['game'].map do |game_data| new profile, game_data, end else [] end end |
Instance Method Details
#achievements(reload = false) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/steam/game.rb', line 14 def achievements reload = false return [] unless has_achievements? if reload or @achievements.nil? @achievements = Achievement.find_all self, @request_options end @achievements end |
#has_achievements? ⇒ Boolean
10 11 12 |
# File 'lib/steam/game.rb', line 10 def has_achievements? !@stats_link.nil? end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/steam/game.rb', line 24 def to_s name end |