Class: Geocoder::Lookup::Geoip2
- Defined in:
- lib/geocoder/lookups/geoip2.rb
Instance Method Summary collapse
-
#initialize ⇒ Geoip2
constructor
A new instance of Geoip2.
- #name ⇒ Object
- #required_api_key_parts ⇒ Object
Methods inherited from Base
#cache, #handle, #map_link_url, #query_url, #search
Constructor Details
#initialize ⇒ Geoip2
Returns a new instance of Geoip2.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/geocoder/lookups/geoip2.rb', line 7 def initialize unless configuration[:file].nil? begin @gem_name = configuration[:lib] || 'maxminddb' require @gem_name rescue LoadError raise "Could not load Maxmind DB dependency. To use the GeoIP2 lookup you must add the #{@gem_name} gem to your Gemfile or have it installed in your system." end end super end |
Instance Method Details
#name ⇒ Object
19 20 21 |
# File 'lib/geocoder/lookups/geoip2.rb', line 19 def name 'GeoIP2' end |
#required_api_key_parts ⇒ Object
23 24 25 |
# File 'lib/geocoder/lookups/geoip2.rb', line 23 def required_api_key_parts [] end |