Skip to content
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

Merged
merged 1 commit into from
Jun 1, 2024

Conversation

whatyouhide
Copy link
Contributor

No description provided.

@@ -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
Copy link
Contributor Author

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()
Copy link
Contributor Author

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()
Copy link
Contributor Author

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?

Copy link
Owner

@wojtekmach wojtekmach Jun 1, 2024

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.

Copy link
Owner

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is var?

Copy link
Contributor Author

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.

@wojtekmach wojtekmach merged commit be9e8ce into wojtekmach:main Jun 1, 2024
2 checks passed
@wojtekmach
Copy link
Owner

Thank you!

@whatyouhide whatyouhide deleted the al/request-docs branch June 2, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants