def waypoints(waypoints)
      if waypoints.kind_of?(Array) and waypoints.length == 2 and waypoints[0].kind_of?(Numeric) and waypoints[1].kind_of?(Numeric)
        waypoints = [waypoints]
      end

      waypoints = as_list(waypoints)
      return join_list('|', waypoints.map { |k| waypoint(k) })
    end
def waypoints(waypoints)
      if waypoints.kind_of?(Array) and waypoints.length == 2 and waypoints[0].kind_of?(Numeric) and waypoints[1].kind_of?(Numeric)
        waypoints = [waypoints]
      end

      waypoints = as_list(waypoints)
      return join_list('|', waypoints.map { |k| waypoint(k) })
    end
Converts an array of waypoints (path) to the format expected by the Google Maps
 server.

 Accept two representation of waypoint:

 1. String: Name of place or comma-separated lat/lon pair.
 2. Hash/Array: Lat/lon pair.

 @param [Array, String, Hash] waypoints Path.

 @return [String]