Class: XboxApi::XboxLive

Inherits:
Thor
  • Object
show all
Defined in:
lib/xbox-api/xboxlive.rb

Instance Method Summary collapse

Instance Method Details

#status(gamertag) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/xbox-api/xboxlive.rb', line 15

def status(gamertag)
  token = TokenHelper.token_exists? ? \
    TokenHelper.get_local_token : \
    TokenHelper.first_run

  client = Client.new(token)
  puts client.gamer(gamertag).presence
end

#tokenObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/xbox-api/xboxlive.rb', line 26

def token
  if options.clear?

    if TokenHelper.token_exists?
      TokenHelper.clear!;
      puts("Token deleted. Rerun `xbl token` to enter a new token")
    else
      puts("No token exists. Rerun `xbl token` to enter a new token")
    end
    
  else
    puts TokenHelper.token_exists? ? TokenHelper.get_local_token : TokenHelper.first_run
  end
end