Created
March 8, 2012 10:51
-
-
Save jlebrech/2000383 to your computer and use it in GitHub Desktop.
Switching base URI
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 Managementdb | |
include HTTParty | |
def self.login(game_name) | |
case game_name | |
when "game1" | |
self.base_uri = "http://game1" | |
when "game2" | |
self.base_uri = "http://game2" | |
when "game3" | |
self.base_uri = "http://game3" | |
end | |
response = self.get("/login") | |
if response.success? | |
@authToken = response["authToken"] | |
else | |
# this just raises the net/http response that was raised | |
raise response.response | |
end | |
end | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment