-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AngelList API role updates. #17
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,26 @@ def get_startups(ids) | |
def startup_search(options={}) | ||
get("1/startups/search", options) | ||
end | ||
|
||
# Returns a company's startup roles. If direction is outgoing, then it returns | ||
# the companies which the given company is tagged in. If direction is incoming, or | ||
# omitted, then it returns the users and companies which are tagged in the given | ||
# company. Results are paginated. | ||
# | ||
# @requires_authentication Optional | ||
# @paginated Yes | ||
# | ||
# @param id [Integer] ID of the desired startup. | ||
# @option options [String] :direction Either incoming or outgoing. Defaults to | ||
# incoming. | ||
# @option options [Integer] :page Specifies the page of results to | ||
# retrieve. | ||
# | ||
# @example Get | ||
# AngellistApi.startup_roles(1234) | ||
def startup_roles(id, options={}) | ||
get("1/startups/#{id}/roles") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, we forgot to pass the options to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh! Want me to fix that? |
||
end | ||
end | ||
end | ||
end | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,5 +32,21 @@ | |
startup = client.startup_search(:domain => '500.co') | ||
startup.angellist_url.should eq 'http://angel.co/500-startups-fund' | ||
end | ||
|
||
it 'gets a company\s startup roles' do | ||
roles = client.startup_roles(1124) | ||
roles.startup_roles.size.should be > 0 | ||
roles.startup_roles.each do |relationship| | ||
ROLES.should include relationship.role | ||
end | ||
end | ||
|
||
it 'gets a company\s outgoing startup roles' do | ||
roles = client.startup_roles(1124) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
roles.startup_roles.size.should be > 0 | ||
roles.startup_roles.each do |relationship| | ||
ROLES.should include relationship.role | ||
end | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not exactly following semver very well with this gem because a.) somehow, someone released a 1.0 version to Rubygems without it being tagged or updated in code (found when I tried to push 9a3ea88 to rubygems), and b.) AngelList considers the API beta and isn't promising any API stability yet. So we really should still be on 0.x releases (I'm tempted to revert to a 0.x scheme and yank the 1.x versions honestly).
Anyhow, it seems pretty nasty to force this parameter on users without a major version bump, especially because there's no new method or name change and, as written, library users can't even choose to override this to keep the old behavior while they work to update their code. Seems like we ought to just document that the user must pass the
v
option himself to get the new behavior and that it will become default in the future (possibly emit a warning if it's called without the option, to warn users of AngelList's deprecation).