Skip to content

Instantly share code, notes, and snippets.

@qmx
Created March 17, 2012 03:59
Show Gist options
  • Save qmx/2054807 to your computer and use it in GitHub Desktop.
Save qmx/2054807 to your computer and use it in GitHub Desktop.
# Option 1 or 2?
# 1
return @app.call(env) if @exclude && @exclude.call(env)
# 2
if @exclude && @exclude.call(env)
return @app.call(env)
end
#3
def excluded?(env) # it would be a lot better to have a meaningful name for this
@exclude && @exclude.call(env)
end
return @app.call(env) if excluded?(env)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment