Class: Dap::Filter::FilterGeoIPOrg
- Inherits:
-
Object
- Object
- Dap::Filter::FilterGeoIPOrg
- Includes:
- BaseDecoder, GeoIPLibrary
- Defined in:
- lib/dap/filter/geoip.rb
Overview
Add GeoIP tags using the MaxMind GeoIP::Organization database
Constant Summary
Constants included from GeoIPLibrary
GeoIPLibrary::GEOIP_ASN, GeoIPLibrary::GEOIP_CITY, GeoIPLibrary::GEOIP_DIRS, GeoIPLibrary::GEOIP_ORGS
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
Methods included from BaseDecoder
Methods included from Base
Instance Method Details
#decode(ip) ⇒ Object
73 74 75 76 77 78 79 80 |
# File 'lib/dap/filter/geoip.rb', line 73 def decode(ip) unless @@geo_orgs raise "No MaxMind GeoIP::Organization data found" end geo_hash = @@geo_orgs.look_up(ip) return unless (geo_hash and geo_hash[:name]) { :org => geo_hash[:name] } end |