diff --git a/README.textile b/README.textile index 5d6bf0d..8dfebdf 100644 --- a/README.textile +++ b/README.textile @@ -6,6 +6,17 @@ A proxy object around the geoip gem for lazy lookup. Includes a Rack middleware. * Rack::MMGeoip pins a MMGeoipProxy to your environment and does the loopup lazy when you first access a geoip property. * Rack::MMGeoip looks for the standard geoip headers and wraps their access, too. So if you're adding these header with mod_geoip in Apache or with http_geoip_module in NGinX these headers are used. So you can use this middleware even in production without compromising performance if NGinX or Apache already adds these headers. +h2. Usage + +

+geo = MMGeoip.new(:ip => '134.34.3.2')
+geo.city        # => "Konstanz"
+geo.region      # => "01" 
+geo.region_name # => "Baden-Wurttemberg"
+geo.lat         # => 47.66669999999999
+geo.lng         # => 9.183300000000003
+
+ h2. Performance Rack::MMGeoip uses the geoip gem. In my tests this lib did about 17_000 lookups in about 17 seconds on my MBP, so you probably lose one ms per request when using the middleware.