Skip to content
Snippets Groups Projects
Commit 16e2d20d authored by Guillaume Dott's avatar Guillaume Dott
Browse files

Store service arrays in instance variable

It makes it easier to add a custom lookup class or filter available
services by manipulating the correct service array.
parent 8dcf1b87
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ module Geocoder ...@@ -20,7 +20,7 @@ module Geocoder
# All street address lookup services, default first. # All street address lookup services, default first.
# #
def street_services def street_services
[ @street_services ||= [
:dstk, :dstk,
:esri, :esri,
:google, :google,
...@@ -49,7 +49,7 @@ module Geocoder ...@@ -49,7 +49,7 @@ module Geocoder
# All IP address lookup services, default first. # All IP address lookup services, default first.
# #
def ip_services def ip_services
[ @ip_services ||= [
:baidu_ip, :baidu_ip,
:freegeoip, :freegeoip,
:geoip2, :geoip2,
...@@ -60,6 +60,8 @@ module Geocoder ...@@ -60,6 +60,8 @@ module Geocoder
] ]
end end
attr_writer :street_services, :ip_services
## ##
# Retrieve a Lookup object from the store. # Retrieve a Lookup object from the store.
# Use this instead of Geocoder::Lookup::X.new to get an # Use this instead of Geocoder::Lookup::X.new to get an
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment