# File lib/cuba.rb, line 115 def call!(env) @env = env @req = settings[:req].new(env) @res = settings[:res].new # This `catch` statement will either receive a # rack response tuple via a `halt`, or will # fall back to issuing a 404. # # When it `catch`es a throw, the return value # of this whole `call!` method will be the # rack response tuple, which is exactly what we want. catch(:halt) do instance_eval(&@blk) res.status = 404 res.finish end end