Skip to content

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)
@LeFnord
Copy link
Member

LeFnord commented Jun 10, 2024

thanks @ericproulx … but it's not my gem 😉

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