Class: Stew::Community::ProfileGame
- Inherits:
-
Object
- Object
- Stew::Community::ProfileGame
- Defined in:
- lib/stew/community/profile_game.rb
Overview
Represents a Steam Game owned by a Steam Id
Instance Attribute Summary collapse
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
-
#logo ⇒ Object
readonly
Returns the value of attribute logo.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#playtime_2weeks ⇒ Object
readonly
Returns the value of attribute playtime_2weeks.
-
#playtime_forever ⇒ Object
readonly
Returns the value of attribute playtime_forever.
-
#store_link ⇒ Object
readonly
Returns the value of attribute store_link.
Instance Method Summary collapse
- #community_url ⇒ Object
- #icon ⇒ Object
-
#initialize(hash) ⇒ ProfileGame
constructor
A new instance of ProfileGame.
- #store_url ⇒ Object
Constructor Details
#initialize(hash) ⇒ ProfileGame
Returns a new instance of ProfileGame.
18 19 20 21 22 23 24 25 26 |
# File 'lib/stew/community/profile_game.rb', line 18 def initialize(hash) @app_id = hash['appid'].to_i @name = hash['name'] @logo = hash['logo'] @playtime_2weeks = hash['playtime_2weeks'].to_i @playtime_forever = hash['playtime_forever'].to_i @img_logo_url = hash['img_logo_url'] @img_icon_url = hash['img_icon_url'] end |
Instance Attribute Details
#app_id ⇒ Object (readonly)
Returns the value of attribute app_id.
6 7 8 |
# File 'lib/stew/community/profile_game.rb', line 6 def app_id @app_id end |
#logo ⇒ Object (readonly)
Returns the value of attribute logo.
10 11 12 |
# File 'lib/stew/community/profile_game.rb', line 10 def logo @logo end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/stew/community/profile_game.rb', line 8 def name @name end |
#playtime_2weeks ⇒ Object (readonly)
Returns the value of attribute playtime_2weeks.
14 15 16 |
# File 'lib/stew/community/profile_game.rb', line 14 def playtime_2weeks @playtime_2weeks end |
#playtime_forever ⇒ Object (readonly)
Returns the value of attribute playtime_forever.
16 17 18 |
# File 'lib/stew/community/profile_game.rb', line 16 def playtime_forever @playtime_forever end |
#store_link ⇒ Object (readonly)
Returns the value of attribute store_link.
12 13 14 |
# File 'lib/stew/community/profile_game.rb', line 12 def store_link @store_link end |
Instance Method Details
#community_url ⇒ Object
32 33 34 |
# File 'lib/stew/community/profile_game.rb', line 32 def community_url "http://steamcommunity.com/app/#{@app_id}" end |
#icon ⇒ Object
36 37 38 |
# File 'lib/stew/community/profile_game.rb', line 36 def icon "http://media.steampowered.com/steamcommunity/public/images/apps/#{@app_id}/#{@img_icon_url}.jpg" end |
#store_url ⇒ Object
28 29 30 |
# File 'lib/stew/community/profile_game.rb', line 28 def store_url "http://store.steampowered.com/app/#{@app_id}" end |