-
Notifications
You must be signed in to change notification settings - Fork 112
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
Polish up Req.Request docs #366
Conversation
@@ -122,45 +122,51 @@ defmodule Req.Request do | |||
Nothing is actually executed until we run the pipeline with `Req.Request.run_request/1`. | |||
### Request steps | |||
### Request Steps |
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.
Consistent title casing.
@@ -575,14 +590,15 @@ defmodule Req.Request do | |||
iex> Req.Request.update_private(req, :b, 11, & &1 + 1).private | |||
%{a: 1, b: 11} | |||
""" | |||
@spec update_private(t(), key :: atom(), default :: term(), (atom() -> term())) :: t() | |||
@spec update_private(t(), key :: atom(), default :: term(), (term() -> term())) :: t() |
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.
This was an error I think.
@@ -632,6 +653,7 @@ defmodule Req.Request do | |||
inspect: &IO.inspect/1 | |||
) | |||
""" | |||
@spec append_request_steps(t(), keyword(fun())) :: t() |
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.
I think we might want to make the request_step
and friends public types, as they are documented in the module doc anyway. Thoughts?
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.
Yeah we can add the type and use it in specs. I’d hold off on speccing request.request_steps and friends though, I want to have an option to add metadata around steps in the future if I need to.
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.
Ah nevermind!
@@ -556,6 +570,7 @@ defmodule Req.Request do | |||
@doc """ | |||
Gets the value for a specific private `key`. | |||
""" | |||
@spec get_private(t(), atom(), default) :: term() | default when default: var |
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.
What is var
?
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.
As far as I always understood it sort of means the same value as whatever you passed in as the arg of the function.
Thank you! |
No description provided.