module SGM
Defined in:
sgm-binding.crsgm-binding/mapping.cr
sgm-binding/version.cr
Constant Summary
-
SERVERS_URL =
"https://www.seriousgmod.com/servers/json"
-
URL to server JSON
-
VERSION =
"0.1.0"
Class Method Summary
-
.get_servers
Sends a GET to SERVERS_URL and returns the json @return String
-
.parse(json : String, type : ServerType = ServerType::Any)
Parse the json response to an Array(Server) @param json : String | The json of the server listing @param type : ServerType | The ServerType to get (refer to sgm/mapping.cr#ServerType) @return Array(Server)
-
.servers(type : ServerType = ServerType::Any)
Get a list of servers @param type : ServerType | Get servers by a ServerType (refer to sgm/mapping.cr#ServerType) @return Array(Server)
Class Method Detail
Parse the json response to an Array(Server) @param json : String | The json of the server listing @param type : ServerType | The ServerType to get (refer to sgm/mapping.cr#ServerType) @return Array(Server)
Get a list of servers @param type : ServerType | Get servers by a ServerType (refer to sgm/mapping.cr#ServerType) @return Array(Server)