Created
February 28, 2012 18:02
-
-
Save jlebrech/1934010 to your computer and use it in GitHub Desktop.
Game profile httparty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Gameprofile | |
include HTTParty | |
base_uri "http://192.168.0.20:7001/management/" | |
attr_accessor :authToken | |
def initialise(authToken) | |
self.authToken = authToken | |
end | |
def login() | |
response = self.class.get("/testLogin") | |
if response.success? | |
response # returns {"authToken":"uuid"} | |
else | |
# this just raises the net/http response that was raised | |
raise response.response | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment