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

Optimize AttributeTranslator #2393

Merged
merged 6 commits into from
Dec 28, 2023

Conversation

ericproulx
Copy link
Contributor

After #2375, I've spent some time understanding the Grape::Router::AttributeTranslator across the gem. I knew already what it did but I didn't know where it was used exactly. This PR is an effort to optimize the usage of the AttributeTranslator but also some refactoring across the Grape::Router classes.

Changes:

  • Introducing Grape::Router::GreedyRoute to encapsulate Grape::Router::AttributeTranslator in the greedy match process.
  • Grape::Router::AttributeTranslator defines more methods to not rely on method_missing internally.
  • Grape::Router::Pattern and Grape::Router::Route have been refactored.

Define setter methods in AttributeTranslator
Combine default route attributes + desc attributes
Refactor Pattern
Remove description in settings
Remove delete options
@ericproulx ericproulx changed the title Optimize AttributeTranslator + Some refactor Optimize AttributeTranslator Dec 28, 2023
@ericproulx ericproulx marked this pull request as ready for review December 28, 2023 12:30
@ericproulx ericproulx requested a review from dblock December 28, 2023 12:30
@dblock dblock merged commit 63a0416 into ruby-grape:master Dec 28, 2023
30 checks passed
@dblock
Copy link
Member

dblock commented Dec 28, 2023

This is better! Thanks.

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