Module: Flocks::Search
- Included in:
- Flocks
- Defined in:
- lib/flocks/search.rb
Instance Method Summary collapse
-
#search_followers(query) ⇒ Object
Search a user’s list of followers.
-
#search_following(query) ⇒ Object
Search a user’s list of following.
-
#search_graph(query) ⇒ Object
Search a user’s entire social graph.
Instance Method Details
#search_followers(query) ⇒ Object
Search a user’s list of followers
10 11 12 |
# File 'lib/flocks/search.rb', line 10 def search_followers(query) redis.zrangebyscore relationship_followers_key, start_score(query), stop_score(query) end |
#search_following(query) ⇒ Object
Search a user’s list of following
5 6 7 |
# File 'lib/flocks/search.rb', line 5 def search_following(query) redis.zrangebyscore relationship_following_key, start_score(query), stop_score(query) end |
#search_graph(query) ⇒ Object
Search a user’s entire social graph
15 16 17 |
# File 'lib/flocks/search.rb', line 15 def search_graph(query) (search_following(query) + search_followers(query)).uniq end |