| Class | GeoIPCity::Database |
| In: |
geoip_city.c
|
| Parent: | Object |
Pass this function an IP address as a string, it will return a hash containing all the information that the database knows about the IP
db.look_up('24.24.24.24')
=> {:city=>"Ithaca", :latitude=>42.4277992248535,
:country_code=>"US", :longitude=>-76.4981994628906,
:country_code3=>"USA", :dma_code=>555,
:country_name=>"United States", :area_code=>607,
:region=>"NY"}
The first argument is the filename of the GeoIPCity.dat file load_option = :standard, :index, or :memory. default :memory check_cache = true or false. default false
filesystem: read database from filesystem, uses least memory.
index: the most frequently accessed index portion of the database,
resulting in faster lookups than :filesystem, but less memory usage than :memory.
memory: load database into memory, faster performance but uses more
memory.
Pass this function an IP address as a string, it will return a hash containing all the information that the database knows about the IP
db.look_up('24.24.24.24')
=> {:city=>"Ithaca", :latitude=>42.4277992248535,
:country_code=>"US", :longitude=>-76.4981994628906,
:country_code3=>"USA", :dma_code=>555,
:country_name=>"United States", :area_code=>607,
:region=>"NY"}