Class: Placefinder::Base
- Inherits:
-
Object
- Object
- Placefinder::Base
- Defined in:
- lib/placefinder/base.rb
Constant Summary
- API_URI =
'http://where.yahooapis.com/geocode'
Instance Method Summary (collapse)
- - (Object) get(params = {})
-
- (Base) initialize(params = {})
constructor
A new instance of Base.
Constructor Details
- (Base) initialize(params = {})
A new instance of Base
8 9 10 |
# File 'lib/placefinder/base.rb', line 8 def initialize(params = {}) @api_key = params[:api_key] end |
Instance Method Details
- (Object) get(params = {})
12 13 14 15 16 |
# File 'lib/placefinder/base.rb', line 12 def get(params = {}) params.merge!({:appid => @api_key}) if @api_key response = HTTParty.get(API_URI, :query => params) response.parsed_response end |