Class: MQProxy

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

Overview

Main class for MapQuest API calls

Instance Method Summary collapse

Instance Method Details

#geocode_address(address, options = {}) ⇒ Object

Get directions from one address to the other



17
18
19
20
21
# File 'lib/mqproxy.rb', line 17

def geocode_address(address, options = {})
  doc = JSON.generate({:location => address, :options => options[:mq_options]})
  xmlInputString = doc.to_s
  return MQProxyGeocode.new(send_to_map_quest(xmlInputString, options))
end

#get_route(source, destination, options = {}) ⇒ Object

Get directions from one address to the other



11
12
13
14
# File 'lib/mqproxy.rb', line 11

def get_route(source, destination, options = {})
  addresses = generate_route_json(source,destination, options[:mq_options])
  return MQProxyRoute.new(route_addresses(addresses,options))
end