Skip to content

Instantly share code, notes, and snippets.

@Raynes
Created December 26, 2011 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynes/1521648 to your computer and use it in GitHub Desktop.
Save Raynes/1521648 to your computer and use it in GitHub Desktop.
(defn ^{:skip-wiki true} route->name
"Parses a set of route args into the keyword name for the route"
[route]
(cond
(keyword? route) route
(fn? route) (keyword (:name (meta route)))
:else (let [res (first (parse-route [{} [route]] 'compojure.core/GET))]
(keyword (:fn-name res)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment