Programmatical access to routes
jodosha opened this issue · 3 comments
jodosha commented
This is a request from @solnic: we should ensure that Hanami::Router
offers a programmatical access to its routes.
AlfonsoUceda commented
jodosha commented
@solnic Ping. 😸
FWIW the new router has @routes
instance variable, which is an array of Hanami::Routing::Route
. Each route object has a complete set of information regarding the path, the name, and the endpoint.
https://github.com/hanami/router/blob/unstable/lib/hanami/routing.rb#L102
There is a no longer used getter Hanami::Router#routes
that we can use to return @routes
. In this way you can probably achieve the goal of the programmatic access to the routes.
https://github.com/hanami/router/blob/unstable/lib/hanami/router.rb#L280
@solnic Please let us to know. Thanks.
jodosha commented
Closing as not actionable.