Methods on Connection with the name of HTTP verb, such as post, depend on run_request, and it receives the following parameters:
url as String, URI, or nil (if it's omitted or explicitly set)
body as String or nil (if it's omitted or explicitly set)
headers as Hash or nil (if it's omitted or explicitly set)
I think the current YARD doc could be updated to follow the implemented behavior. Especially, the URI type looks to be worth being described because the type is supported by `Request#url.
Besides, I updated the body of run_request as well as Request#body because the body will be passed to Faraday::Env#new through Request#to_env, and Faraday::Env#body seems String.
Todos
~[ ] Tests~ (This PR just updated the YARD doc)
[x] Documentation
Additional Notes
Perhaps, other YARD comments could be updated, but I focused on run_request and its related methods.
Description
Methods on
Connection
with the name of HTTP verb, such aspost
, depend onrun_request
, and it receives the following parameters:url
asString
,URI
, ornil
(if it's omitted or explicitly set)body
asString
ornil
(if it's omitted or explicitly set)headers
asHash
ornil
(if it's omitted or explicitly set)I think the current YARD doc could be updated to follow the implemented behavior. Especially, the
URI
type looks to be worth being described because the type is supported by `Request#url.Besides, I updated the
body
ofrun_request
as well asRequest#body
because thebody
will be passed toFaraday::Env#new
throughRequest#to_env
, andFaraday::Env#body
seemsString
.Todos
Additional Notes
Perhaps, other YARD comments could be updated, but I focused on
run_request
and its related methods.