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