| Class | GeoIP |
| In: |
lib/geoip.rb
|
| Parent: | Object |
| VERSION | = | "1.6.4" | The GeoIP GEM version number | |
| DATA_DIR | = | File.expand_path(File.join(File.dirname(__FILE__),'..','data','geoip')) | The +data/+ directory for geoip | |
| CountryCode | = | YAML.load_file(File.join(DATA_DIR,'country_code.yml')) | Ordered list of the ISO3166 2-character country codes, ordered by GeoIP ID | |
| CountryCode3 | = | YAML.load_file(File.join(DATA_DIR,'country_code3.yml')) | Ordered list of the ISO3166 3-character country codes, ordered by GeoIP ID | |
| CountryName | = | YAML.load_file(File.join(DATA_DIR,'country_name.yml')) | Ordered list of the English names of the countries, ordered by GeoIP ID | |
| CountryContinent | = | YAML.load_file(File.join(DATA_DIR,'country_continent.yml')) | Ordered list of the ISO3166 2-character continent code of the countries, ordered by GeoIP ID | |
| RegionName | = | YAML.load_file(File.join(DATA_DIR,'region.yml')) | Load a hash of region names by region code | |
| TimeZone | = | YAML.load_file(File.join(DATA_DIR,'time_zone.yml')) | Hash of the timezone codes mapped to timezone name, per zoneinfo | |
| GEOIP_COUNTRY_EDITION | = | 1 | ||
| GEOIP_CITY_EDITION_REV1 | = | 2 | ||
| GEOIP_REGION_EDITION_REV1 | = | 3 | ||
| GEOIP_ISP_EDITION | = | 4 | ||
| GEOIP_ORG_EDITION | = | 5 | ||
| GEOIP_CITY_EDITION_REV0 | = | 6 | ||
| GEOIP_REGION_EDITION_REV0 | = | 7 | ||
| GEOIP_PROXY_EDITION | = | 8 | ||
| GEOIP_ASNUM_EDITION | = | 9 | ||
| GEOIP_NETSPEED_EDITION | = | 10 | ||
| GEOIP_COUNTRY_EDITION_V6 | = | 12 | ||
| GEOIP_CITY_EDITION_REV1_V6 | = | 30 | ||
| GEOIP_NETSPEED_EDITION_REV1 | = | 32 | ||
| GEOIP_UNKNOWN_SPEED | = | 0 | Numeric codes for NETSPEED (NETSPEED_REV1* is string-based): | |
| GEOIP_DIALUP_SPEED | = | 1 | ||
| GEOIP_CABLEDSL_SPEED | = | 2 | ||
| GEOIP_CORPORATE_SPEED | = | 3 |
| database_type | -> | databaseType |
| database_type | [R] | The Edition number that identifies which kind of database you‘ve opened |
| local_ip_alias | [RW] | An IP that is used instead of local IPs |
Open the GeoIP database and determine the file format version.
filename is a String holding the path to the GeoIP.dat file options is a Hash allowing you to specify the caching options
Search a ASN GeoIP database for the specified host, returning the AS number and description.
Many other types of GeoIP database (e.g. userType) mis-identify as ASN type, and this can read those too.
hostname is a String holding the host‘s DNS name or numeric IP address.
Returns the AS number and description.
Source: geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
Search the GeoIP database for the specified host, returning city info.
hostname is a String holding the host‘s DNS name or numeric IP address.
Returns a City object with the fourteen elements:
Search the GeoIP database for the specified host, returning country info.
hostname is a String holding the host‘s DNS name or numeric IP address.
If the database is a City database (normal), return the result that city would return.
Otherwise, return a Country object with the seven elements:
Search a GeoIP Connection Type (Netspeed) database for the specified host, returning the speed code.
hostname is a String holding the host‘s DNS name or numeric IP address.
Search the GeoIP database for the specified host, returning region info.
hostname is a String holding the hosts‘s DNS name or numeric IP address.
Returns a Region object with the nine elements: