Class: XboxApi::Gamer
- Inherits:
-
Object
- Object
- XboxApi::Gamer
- Defined in:
- lib/xbox-api/gamer.rb
Constant Summary collapse
- ENDPOINTS =
[ :presence, :profile, :gamercard, :activity, :friends, :followers, :xbox360games, :xboxonegames, :game_clips ]
Instance Attribute Summary collapse
-
#gamertag ⇒ Object
readonly
Returns the value of attribute gamertag.
-
#xuid ⇒ Object
readonly
Returns the value of attribute xuid.
Instance Method Summary collapse
-
#initialize(gamertag, client, xuid = nil) ⇒ Gamer
constructor
A new instance of Gamer.
- #recent_activity ⇒ Object
Constructor Details
#initialize(gamertag, client, xuid = nil) ⇒ Gamer
Returns a new instance of Gamer.
18 19 20 21 22 |
# File 'lib/xbox-api/gamer.rb', line 18 def initialize(gamertag, client, xuid=nil) @gamertag = gamertag @client = client @xuid = xuid || fetch_xuid end |
Instance Attribute Details
#gamertag ⇒ Object (readonly)
Returns the value of attribute gamertag.
4 5 6 |
# File 'lib/xbox-api/gamer.rb', line 4 def gamertag @gamertag end |
#xuid ⇒ Object (readonly)
Returns the value of attribute xuid.
4 5 6 |
# File 'lib/xbox-api/gamer.rb', line 4 def xuid @xuid end |
Instance Method Details
#recent_activity ⇒ Object
31 32 33 34 |
# File 'lib/xbox-api/gamer.rb', line 31 def recent_activity endpoint = "#{xuid}/activity/recent" client.fetch_body_and_parse( endpoint ) end |