I have a group of lines (used in Googlemaps display) based on 2 arrays
:
zl = 9 if farthest_proposition.distance_to(origin) < = 25.0
zl = 10 if farthest_proposition.distance_to(origin) <= 15.0
zl = 11 if farthest_proposition.distance_to(origin) <= 10.0
zl = 12 if farthest_proposition.distance_to(origin) <= 5.0
zl = 13 if farthest_proposition.distance_to(origin) < =2.0
zl = 14 if farthest_proposition.distance_to(origin) <= 1.0
how could I replace it the dryest way possible ?
zl = [9, 10, 11, 12, 13, 14]
distance = [1.0, 2.0, 5.0, 10.0, 15.0, 25.0]
farthest_proposition.distance_to(origin) is never > 25 (eliminated
before…)
farthest_proposition.distance_to(origin) can be 0.0, never negative
thanks for yoru suggestions…
joss