Class: WeatherApi::Client
- Inherits:
-
Object
- Object
- WeatherApi::Client
- Defined in:
- lib/current_weather/client.rb
Constant Summary collapse
- BASE_URL =
'http://www.google.com'
Instance Method Summary collapse
- #get_weather(location) ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
Constructor Details
Instance Method Details
#get_weather(location) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/current_weather/client.rb', line 12 def get_weather(location) response = @connection.get do |req| req.url '/ig/api' req.headers['Accept'] = 'application/xml' req.params['weather'] = location end response.body end |