lib/undergroundweather/api_call.rb in undergroundweather-0.0.1 vs lib/undergroundweather/api_call.rb in undergroundweather-0.0.2
- old
+ new
@@ -13,25 +13,25 @@
@feature = feature
@query = query
@error = false
@response = JSON.parse(get)
- @error = true if @response['error']
+ @error = true if @response['response']['error']
end
def url
URI.parse("#{BASE_URL}/#{@api_key}/#{@feature}/q/#{@query}.json")
end
def get
- puts "Calling #{url}"
resp = Net::HTTP.get_response(url)
if resp.code == "200"
resp.body
else
- puts "error retrieving weather feed"
@error = true
+
+ # raise exception here
{}
end
end
end
end
\ No newline at end of file