Class: CDMDEXER::GeoNameIDToJson
- Inherits:
-
Object
- Object
- CDMDEXER::GeoNameIDToJson
- Defined in:
- lib/cdmdexer/formatters.rb
Constant Summary collapse
- URL =
"http://ws.geonames.net/getJSON?username=#{ENV['GEONAMES_USER']}&token=#{ENV['GEONAMES_TOKEN']}"
Class Method Summary collapse
Class Method Details
.format(value) ⇒ Object
16 17 18 |
# File 'lib/cdmdexer/formatters.rb', line 16 def self.format(value) JSON.parse(Net::HTTP.get_response(URI.parse("#{URL}&geonameId=#{value}")).body) end |