Skip to content

Implement @param tag handling#21

Open
rintaun wants to merge 3 commits intorkh:masterfrom
rintaun:feature/param-tags
Open

Implement @param tag handling#21
rintaun wants to merge 3 commits intorkh:masterfrom
rintaun:feature/param-tags

Conversation

@rintaun
Copy link
Copy Markdown

@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
Copy Markdown
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