Class: Placefinder::Base

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

Constant Summary collapse

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

Instance Method Summary collapse

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