Class: Placefinder::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/placefinder/base.rb

Constant Summary

API_URI =
'http://where.yahooapis.com/geocode'

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Base



8
9
10
# File 'lib/placefinder/base.rb', line 8

def initialize(params = {})
  @api_key = params[:api_key]
end

Instance Method Details

#get(params = {}) ⇒ Object



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