Module: Geocoder::Lookup

Extended by:
Lookup
Included in:
Lookup
Defined in:
lib/geocoder/lookup.rb,
lib/geocoder/lookups/okf.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/here.rb,
lib/geocoder/lookups/test.rb,
lib/geocoder/lookups/baidu.rb,
lib/geocoder/lookups/yahoo.rb,
lib/geocoder/lookups/geoip2.rb,
lib/geocoder/lookups/google.rb,
lib/geocoder/lookups/telize.rb,
lib/geocoder/lookups/yandex.rb,
lib/geocoder/lookups/maxmind.rb,
lib/geocoder/lookups/baidu_ip.rb,
lib/geocoder/lookups/geocodio.rb,
lib/geocoder/lookups/mapquest.rb,
lib/geocoder/lookups/pointpin.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/opencagedata.rb,
lib/geocoder/lookups/maxmind_local.rb,
lib/geocoder/lookups/google_premier.rb,
lib/geocoder/lookups/smarty_streets.rb,
lib/geocoder/lookups/postcode_anywhere_uk.rb,
lib/geocoder/lookups/google_places_details.rb

Defined Under Namespace

Classes: Baidu, BaiduIp, Base, Bing, Dstk, Esri, Freegeoip, GeocoderCa, GeocoderUs, Geocodio, Geoip2, Google, GooglePlacesDetails, GooglePremier, Here, Mapquest, Maxmind, MaxmindLocal, Nominatim, Okf, Opencagedata, Ovi, Pointpin, PostcodeAnywhereUk, SmartyStreets, Telize, 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.



68
69
70
71
72
# File 'lib/geocoder/lookup.rb', line 68

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.



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/geocoder/lookup.rb', line 51

def ip_services
  [
    :baidu_ip,
    :freegeoip,
    :geoip2,
    :maxmind,
    :maxmind_local,
    :telize,
    :pointpin
  ]
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
40
41
42
43
44
45
46
# File 'lib/geocoder/lookup.rb', line 22

def street_services
  [
    :dstk,
    :esri,
    :google,
    :google_premier,
    :google_places_details,
    :yahoo,
    :bing,
    :geocoder_ca,
    :geocoder_us,
    :yandex,
    :nominatim,
    :mapquest,
    :opencagedata,
    :ovi,
    :here,
    :baidu,
    :geocodio,
    :smarty_streets,
    :okf,
    :postcode_anywhere_uk,
    :test
  ]
end