Module: AngellistApi::Client::Paths
- Included in:
- AngellistApi::Client
- Defined in:
- lib/angellist_api/client/paths.rb
Overview
Defines methods related to path resources (social connections)
Instance Method Summary collapse
-
#get_paths(options = {}) ⇒ Object
Show paths between you and given user/startup ids.
Instance Method Details
#get_paths(options = {}) ⇒ Object
TODO:
This is a great case for a 2.0 version of our lib that has some real OOP abstraction – the results of this as a dumb hash are pretty disgusting to work with.
Show paths between you and given user/startup ids.
Additional notes:
-
for each user/startup up to 10 different paths will show up
-
up to 20 ids per request are allowed
-
do not use user_ids and startup_ids at the same time
28 29 30 31 32 33 34 35 36 |
# File 'lib/angellist_api/client/paths.rb', line 28 def get_paths(={}) user_ids = .delete(:user_ids) { [] } startup_ids = .delete(:startup_ids) { [] } .merge!(:user_ids => user_ids.join(',')) if user_ids.any? .merge!(:startup_ids => startup_ids.join(',')) if startup_ids.any? get('1/paths', ) end |