Advertisement
Guest User

Untitled

a guest
May 27th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. (defn gateway-fn
  2. "Retrieves a function given it's full name"
  3. [gateway access method]
  4. {:post [(not (nil? %))]}
  5. (let [sym (symbol (str "project-namespace." (name gateway) "." (name access) "/" (name method)))]
  6. (resolve sym)))
  7.  
  8. (defn gateway-call
  9. "Dispatches to a function on the given provider"
  10. [access method & args]
  11. (let [gateway (gateway-provider)
  12. f (gateway-fn gateway access method)]
  13. (if args
  14. (apply f args)
  15. (f))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement