Class: Stew::Community::ProfileGame

Inherits:
Object
  • Object
show all
Defined in:
lib/stew/community/profile_game.rb

Overview

Represents a Steam Game owned by a Steam Id

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject (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

#logoObject (readonly)

Returns the value of attribute logo.



10
11
12
# File 'lib/stew/community/profile_game.rb', line 10

def 
  @logo
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/stew/community/profile_game.rb', line 8

def name
  @name
end

#playtime_2weeksObject (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_foreverObject (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

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_urlObject



32
33
34
# File 'lib/stew/community/profile_game.rb', line 32

def community_url
  "http://steamcommunity.com/app/#{@app_id}"
end

#iconObject



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_urlObject



28
29
30
# File 'lib/stew/community/profile_game.rb', line 28

def store_url
  "http://store.steampowered.com/app/#{@app_id}"
end