Skip to content

Instantly share code, notes, and snippets.

@jits
jits / lambdas.rb
Last active January 3, 2016 13:59 — forked from wuputah/lambda-vs-array.rb
require 'benchmark'
def get_lambda
lambda { }
end
def my_method; end
Benchmark.bmbm do |x|
x.report { 1_000_000.times { method(:my_method) } }
class ApplicationController < ActionController::Base
protect_from_forgery
rescue_from CanCan::AccessDenied do |exception|
flash[:alert] = exception.message
redirect_to root_url
end
protected