class Sinatra::Base

def template(name, &block)

Define a named template. The block must return the template source.
def template(name, &block)
  filename, line = caller_locations.first
  templates[name] = [block, filename, line.to_i]
end