module SGM

Defined in:

sgm-binding.cr
sgm-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

Class Method Detail

def self.get_servers #

Sends a GET to SERVERS_URL and returns the json @return String


[View source]
def self.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)


[View source]
def self.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)


[View source]