class IP2Country

Defined in:

ip2country.cr

Constant Summary

CACHE_DIR = (File.expand_path(File.dirname(File.dirname("/srv/crystaldoc.info/github-arcage-ip2country-v0.1.4/src/ip2country.cr")))) + "/cache"
LANGS = Set.new(["en", "fr", "de", "es", "pt", "ja", "ko", "zh"])
REGISTRARS = {"ARIN" => "http://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest", "RIPE" => "https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest", "APNIC" => "https://ftp.apnic.net/stats/apnic/delegated-apnic-extended-latest", "LACNIC" => "http://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest", "AFRINIC" => "http://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest"}
VERSION = "0.1.4"

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(default_lang : String = "en") #

[View source]

Class Method Detail

def self.cache_update #

[View source]

Instance Method Detail

def lookup(addr : String, lang : String = @default_lang) : String #

[View source]
def lookup(addr : IPAddr, lang : String = @default_lang) : String #

[View source]
def lookup_all(addr : String) : Hash(String, String) #

[View source]
def lookup_all(addr : IPAddr) : Hash(String, String) #

[View source]