Say I have:
require 'sinatra'
get '/' { "hi" }
get '/a' { "a" }
get '/b' { "b" }
Is there any easy to way obtain a list of all defined routes in my Sinatra application?
I investigated Sinatra::Base.routes
, but that doesn't appear to contain the routes I just defined.
I was hoping to have a nice way to make a self documenting API like routes.each { |r| p r }
to get:
/
/a
/b