Module: Geocoder::Lookup

Extended by:
Lookup
Included in:
Lookup
Defined in:
lib/geocoder/lookup.rb,
lib/geocoder/lookups/ovi.rb,
lib/geocoder/lookups/base.rb,
lib/geocoder/lookups/bing.rb,
lib/geocoder/lookups/dstk.rb,
lib/geocoder/lookups/esri.rb,
lib/geocoder/lookups/test.rb,
lib/geocoder/lookups/baidu.rb,
lib/geocoder/lookups/yahoo.rb,
lib/geocoder/lookups/google.rb,
lib/geocoder/lookups/yandex.rb,
lib/geocoder/lookups/maxmind.rb,
lib/geocoder/lookups/mapquest.rb,
lib/geocoder/lookups/freegeoip.rb,
lib/geocoder/lookups/nominatim.rb,
lib/geocoder/lookups/geocoder_ca.rb,
lib/geocoder/lookups/geocoder_us.rb,
lib/geocoder/lookups/google_premier.rb

Defined Under Namespace

Classes: Baidu, Base, Bing, Dstk, Esri, Freegeoip, GeocoderCa, GeocoderUs, Google, GooglePremier, Mapquest, Maxmind, Nominatim, Ovi, Test, Yahoo, Yandex

Instance Method Summary collapse

Instance Method Details

#all_servicesObject

Array of valid Lookup service names.


8
9
10
# File 'lib/geocoder/lookup.rb', line 8

def all_services
  street_services + ip_services
end

#all_services_except_testObject

Array of valid Lookup service names, excluding :test.


15
16
17
# File 'lib/geocoder/lookup.rb', line 15

def all_services_except_test
  all_services - [:test]
end

#get(name) ⇒ Object

Retrieve a Lookup object from the store. Use this instead of Geocoder::Lookup::X.new to get an already-configured Lookup object.


53
54
55
56
57
# File 'lib/geocoder/lookup.rb', line 53

def get(name)
  @services = {} unless defined?(@services)
  @services[name] = spawn(name) unless @services.include?(name)
  @services[name]
end

#ip_servicesObject

All IP address lookup services, default first.


44
45
46
# File 'lib/geocoder/lookup.rb', line 44

def ip_services
  [:freegeoip, :maxmind]
end

#street_servicesObject

All street address lookup services, default first.


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/geocoder/lookup.rb', line 22

def street_services
  [
    :dstk,
    :esri,
    :google,
    :google_premier,
    :yahoo,
    :bing,
    :geocoder_ca,
    :geocoder_us,
    :yandex,
    :nominatim,
    :mapquest,
    :ovi,
    :baidu,
    :test
  ]
end