Skip to content
Snippets Groups Projects
Commit 4696fa69 authored by Alex Reisner's avatar Alex Reisner
Browse files

Refactor: improve Lookup class name derivation.

parent b147d7ea
No related branches found
No related tags found
No related merge requests found
......@@ -67,7 +67,8 @@ module Geocoder
if valid_lookups.include?(name)
name = name.to_s
require "geocoder/lookups/#{name}"
eval("Geocoder::Lookup::#{name[0...1].upcase + name[1..-1]}.new")
klass = name.split("_").map{ |i| i[0...1].upcase + i[1..-1] }.join
eval("Geocoder::Lookup::#{klass}.new")
else
valids = valid_lookups.map{ |l| ":#{l}" }.join(", ")
raise ConfigurationError, "Please specify a valid lookup for Geocoder " +
......
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