mount_proc
allows you to specify a piece of code (a proc) that will be run when a request comes in. Here's a simple hello world example adapted from the Ruby documentation
require 'webrick'
server = WEBrick::HTTPServer.new :Port => 8000
server.mount_proc '/' do |req, res|
res.body = 'Hello, world!'
end
trap('INT') { server.stop } # stop server with Ctrl-C
server.start
now point your browser to http://localhost:8000
and you should see
Hello, world!