Class: PopulationGrowthClient
- Inherits:
-
Object
- Object
- PopulationGrowthClient
- Defined in:
- lib/population_growth_client.rb
Overview
Population growth client
Class Method Summary collapse
-
.search_zip(zip_code) ⇒ Object
Search population growth by zip code.
Class Method Details
.search_zip(zip_code) ⇒ Object
Search population growth by zip code
7 8 9 10 11 12 |
# File 'lib/population_growth_client.rb', line 7 def self.search_zip(zip_code) url = 'http://population-growth-ps.herokuapp.com/search-zip/' uri = URI(url + zip_code.to_s) response = Net::HTTP.get_response(uri) JSON.parse(response.body) if response.code == '200' end |