Skip to content

Instantly share code, notes, and snippets.

@devn

devn/get_env.clj Secret

Last active December 20, 2015 07: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 devn/46b4f7a871e1ac0d5b9a to your computer and use it in GitHub Desktop.
Save devn/46b4f7a871e1ac0d5b9a to your computer and use it in GitHub Desktop.
(defprotocol EnvMap
(get [map key] [map key not-found]))
(extend-protocol EnvMap
java.util.Collections$UnmodifiableMap
(get ([map key]
(clojure.core/get (keywordize-keys (into {} map))
(-> key name .toUpperCase keyword)))
([map key not-found]
(clojure.core/get (keywordize-keys (into {} map))
(-> key name .toUpperCase keyword)
not-found))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment