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

Use route.namespace instead instance_variable_get(@options) #931

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ericproulx
Copy link
Contributor

While trying to improve some parts of Grape, I came across an error in your gem since my code had removed @options in Grape::Router::Route. This PR replaces the instance_variable_get by simply using route.namespace which is accessible from an instance of Grape::Router::Route.

I also refactor some small methods like route_namespace_equals? by using an Enumerator instead of if with interpolation. Ain't a big change but it will lazily interporlate strings if needed.

Rename `route_instance_variable_equals?` to `route_namespace_equals?`
Refactor route_path_start_with? and route_namespace_equals? with Enumerator instead of static Arrays
Refactor determine_namespaced_routes in positive logic (select over reject)
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.

None yet

1 participant