Class: Pinpoint::MapableService::YahooMaps
- Inherits:
-
Object
- Object
- Pinpoint::MapableService::YahooMaps
- Defined in:
- lib/pinpoint/mapable_services/yahoo_maps.rb
Class Method Summary collapse
-
.map_url(options = {}) ⇒ Object
Private: Renders a URL for a given location and location name using the Yahoo Maps mapping service.
Class Method Details
.map_url(options = {}) ⇒ Object
Private: Renders a URL for a given location and location name using the Yahoo Maps mapping service.
The location and location name will be properly escaped.
options - A Hash of options used in the method
:location - A String representing the location to display
via the map URL
:location_name - A String representing the name of the
location to be displayed via the map URL
Example
map_url location: 'London, UK',
location_name: 'Capital of the UK'
# => http://maps.yahoo.com#q=London%2C+UK&tt=Capital+of+the+UK
25 26 27 28 29 30 31 32 33 |
# File 'lib/pinpoint/mapable_services/yahoo_maps.rb', line 25 def self.map_url( = {}) escaped_map_location = CGI.escape .fetch(:location).to_str escaped_location_name = CGI.escape .fetch(:location_name) 'http://maps.yahoo.com#q=' + escaped_map_location + '&tt=' + escaped_location_name end |