Class: WalkscoreApi::Client
- Inherits:
-
Object
- Object
- WalkscoreApi::Client
- Defined in:
- lib/walkscore/client.rb
Constant Summary collapse
- BASE_URL =
'http://api.walkscore.com'
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #make_connection(location, api_key) ⇒ Object
Constructor Details
Instance Method Details
#make_connection(location, api_key) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/walkscore/client.rb', line 11 def make_connection(location, api_key) response = @connection.get do |req| req.url '/score' req.headers['Accepts'] = 'application/json' req.params['format'] = 'json' req.params['lat'] = location[:lat] req.params['lon'] = location[:long] req.params['wsapikey'] = api_key end response.body end |