Module: Lite::Redis::GeoHelper
Instance Method Summary collapse
- #create(key, *member) ⇒ Object
- #distance(key, member1, member2, unit = 'm') ⇒ Object
- #hash(key, member) ⇒ Object
- #position(key, member) ⇒ Object
- #radius(*args, **geoptions) ⇒ Object
- #radius_member(*args, **geoptions) ⇒ Object
Instance Method Details
#create(key, *member) ⇒ Object
7 8 9 |
# File 'lib/lite/redis/helpers/geo_helper.rb', line 7 def create(key, *member) client.geoadd(key.to_s, *member) end |
#distance(key, member1, member2, unit = 'm') ⇒ Object
19 20 21 |
# File 'lib/lite/redis/helpers/geo_helper.rb', line 19 def distance(key, member1, member2, unit = 'm') client.geodist(key.to_s, member1, member2, unit.to_s) end |
#hash(key, member) ⇒ Object
11 12 13 |
# File 'lib/lite/redis/helpers/geo_helper.rb', line 11 def hash(key, member) client.geohash(key.to_s, member) end |
#position(key, member) ⇒ Object
15 16 17 |
# File 'lib/lite/redis/helpers/geo_helper.rb', line 15 def position(key, member) client.geopos(key.to_s, member) end |
#radius(*args, **geoptions) ⇒ Object
23 24 25 |
# File 'lib/lite/redis/helpers/geo_helper.rb', line 23 def radius(*args, **) client.georadius(*args, **) end |
#radius_member(*args, **geoptions) ⇒ Object
27 28 29 |
# File 'lib/lite/redis/helpers/geo_helper.rb', line 27 def radius_member(*args, **) client.georadiusbymember(*args, **) end |