Groovy web console

subscribe to the feed Subscribe
to this
site
Templating Is Dumb (via #groovywebconsole)
tweet this snippet Tweet
this
script

Templating Is Dumb

Published 3 months ago by vishal
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
webhooks = [staging: 'foo', production: 'bar']

var = 'staging'
key = var
println "your hook is ${webhooks.get(key)}"

notKey = "${var}"
println "your hook is ${webhooks.get(notKey)}"