Module: Lite::Redis::GeoHelper

Included in:
Geo, Geo
Defined in:
lib/lite/redis/helpers/geo_helper.rb

Instance Method Summary collapse

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, **geoptions)
  client.georadius(*args, **geoptions)
end

#radius_member(*args, **geoptions) ⇒ Object



27
28
29
# File 'lib/lite/redis/helpers/geo_helper.rb', line 27

def radius_member(*args, **geoptions)
  client.georadiusbymember(*args, **geoptions)
end