Class: Geocoder::Lookup::MaxmindLocal

Inherits:
Base
  • Object
show all
Defined in:
lib/geocoder/lookups/maxmind_local.rb

Instance Method Summary collapse

Methods inherited from Base

#cache, #handle, #map_link_url, #query_url, #search

Constructor Details

#initializeMaxmindLocal

Returns a new instance of MaxmindLocal.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/geocoder/lookups/maxmind_local.rb', line 8

def initialize
  if !configuration[:file].nil?
    begin
      gem = RUBY_PLATFORM == 'java' ? 'jgeoip' : 'geoip'
      require gem
    rescue LoadError
      raise "Could not load geoip dependency. To use MaxMind Local lookup you must add the #{gem} gem to your Gemfile or have it installed in your system."
    end
  end
  super
end

Instance Method Details

#nameObject



20
21
22
# File 'lib/geocoder/lookups/maxmind_local.rb', line 20

def name
  "MaxMind Local"
end

#required_api_key_partsObject



24
25
26
# File 'lib/geocoder/lookups/maxmind_local.rb', line 24

def required_api_key_parts
  []
end