Skip to content

Instantly share code, notes, and snippets.

@jlebrech
Created February 28, 2012 18:02
Show Gist options
  • Save jlebrech/1934010 to your computer and use it in GitHub Desktop.
Save jlebrech/1934010 to your computer and use it in GitHub Desktop.
Game profile httparty
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