GeoKit: More Syntactic Sugar
We just checked in code which improves the readability of GeoKit’s finders. Its quite obvious from the code, so just take a look at these examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# Find the nearest store. stores = Store.find(:nearest, :origin => an_origin) # Find the farthest store away. stores = Store.find(:farthest, :origin => an_origin) # Find within a radius. stores = Store.find(:all, :within => 5, :origin => an_origin) # Find outside a radius. stores = Store.find(:all, :beyond => 5, :origin => an_origin) # Find within a range. stores = Store.find(:all, :range => 5..10, :origin => an_origin) |