Skip to content

Instantly share code, notes, and snippets.

@cypher
Created April 14, 2010 20:13
Show Gist options
  • Select an option

  • Save cypher/366281 to your computer and use it in GitHub Desktop.

Select an option

Save cypher/366281 to your computer and use it in GitHub Desktop.
my_handler = lambda do
# stuff
end
get '/foo', &my_handler
post '/bar', &my_handler
@rkh
Copy link
Copy Markdown

rkh commented Apr 14, 2010

Also, you can do:

def foo
   # ...
end

get '/foo', &method(:foo)

That should also perform better.

@cypher
Copy link
Copy Markdown
Author

cypher commented Apr 14, 2010

Nice. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment