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

Implement @param tag handling #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rintaun
Copy link

@rintaun rintaun commented Jul 29, 2018

By parsing the route using Mustermann, we can find the named parameters; these can then be passed to the RouteObject so that YARD doesn't complain. It is important to set the docstring after the parameters are set, otherwise the unknown parameter warning will still occur once.

In RouteObject, we need to override the parameters attribute to prevent parameters from being shown in the signature of the route 'method', e.g. #GET /:id(id), which looks strange.

Fixes #6.

rintaun added 3 commits July 29, 2018 17:39
By parsing the route using Mustermann, we can find the named parameters; 
these can then be passed to the RouteObject so that YARD doesn't 
complain. It is important to set the docstring *after* the parameters 
are set, otherwise the unknown parameter warning will still occur once.

In RouteObject, we need to override the parameters attribute to prevent 
parameters from being shown in the signature of the route 'method', e.g. 
`#GET /:id(id)`, which looks strange.
@rintaun
Copy link
Author

rintaun commented Jul 29, 2018

Because Mustermann requires Ruby > 2.2.0, this will not work with earlier versions.

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.

1 participant