Skip to content

Instantly share code, notes, and snippets.

@smathy
Created October 22, 2011 19:35
Show Gist options
  • Save smathy/1306400 to your computer and use it in GitHub Desktop.
Save smathy/1306400 to your computer and use it in GitHub Desktop.
in_foobar_queue = (queue_array) ->
ret = false
queue_array.each (queue_id) ->
queue_name = http.get("http://foo.com/queue/#{queue_id}").name
if queue_name == 'foobar'
ret = true
break
return ret
ticket = http.get('http://foo.com/ticket/45')
if in_foobar_queue( ticket.queues )
# do something
else
# do something else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment