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

Document classify_name and don't require string.

parent d486b781
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,6 @@ module Geocoder
#
def spawn(name)
if all_services.include?(name)
name = name.to_s
Geocoder::Lookup.const_get(classify_name(name)).new
else
valids = all_services.map(&:inspect).join(", ")
......@@ -58,8 +57,11 @@ module Geocoder
end
end
##
# Convert an "underscore" version of a name into a "class" version.
#
def classify_name(filename)
filename.split("_").map{ |i| i[0...1].upcase + i[1..-1] }.join
filename.to_s.split("_").map{ |i| i[0...1].upcase + i[1..-1] }.join
end
end
end
......
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