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