Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn gateway-fn
- "Retrieves a function given it's full name"
- [gateway access method]
- {:post [(not (nil? %))]}
- (let [sym (symbol (str "project-namespace." (name gateway) "." (name access) "/" (name method)))]
- (resolve sym)))
- (defn gateway-call
- "Dispatches to a function on the given provider"
- [access method & args]
- (let [gateway (gateway-provider)
- f (gateway-fn gateway access method)]
- (if args
- (apply f args)
- (f))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement