Class: Stew::Community::SteamId
- Inherits:
-
Object
- Object
- Stew::Community::SteamId
- Defined in:
- lib/stew/community/steam_id.rb
Overview
The base class for all Steam Ids. Has accessors for the base profile, games and friends of a Steam Id
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #friends ⇒ Object
- #games ⇒ Object
-
#initialize(data, opts = {}) ⇒ SteamId
constructor
A new instance of SteamId.
- #profile ⇒ Object
Constructor Details
#initialize(data, opts = {}) ⇒ SteamId
Returns a new instance of SteamId.
16 17 18 19 |
# File 'lib/stew/community/steam_id.rb', line 16 def initialize(data,opts={}) @client = opts[:client] || Stew.config[:default_community_client].new @id = SteamIdResolver.new(@client).steam_id(data) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
14 15 16 |
# File 'lib/stew/community/steam_id.rb', line 14 def id @id end |
Instance Method Details
#friends ⇒ Object
29 30 31 |
# File 'lib/stew/community/steam_id.rb', line 29 def friends @friends ||= ProfileFriends.new @client.profile_friends(@id) end |
#games ⇒ Object
25 26 27 |
# File 'lib/stew/community/steam_id.rb', line 25 def games @games ||= ProfileGames.new @client.profile_games(@id) end |
#profile ⇒ Object
21 22 23 |
# File 'lib/stew/community/steam_id.rb', line 21 def profile @profile ||= Profile.new(@client.profile(@id)) end |