5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/mapbox/isochrone.rb', line 5
def self.assemble_params(options={})
contours_minutes = options[:contours_minutes]
contours_colors = options[:contours_colors]
params = ''
opts = options.select { |key, value| key != :contours_minutes && key != :contours_colors }
if opts.length > 0
params += "#{params.length > 0 ? '&' : '?'}#{URI.encode_www_form(opts)}"
end
if contours_minutes then
params += "#{params.length > 0 ? '&' : '?'}contours_minutes=#{contours_minutes.join(',')}"
end
if contours_colors then
params += "#{params.length > 0 ? '&' : '?'}contours_colors=#{contours_colors.join(',')}"
end
return params
end
|