Class: CDMBL::GeoNameIDToJson

Inherits:
Object
  • Object
show all
Defined in:
lib/cdmbl/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/cdmbl/formatters.rb', line 16

def self.format(value)
  JSON.parse(Net::HTTP.get_response(URI.parse("#{URL}&geonameId=#{value}")).body)
end