Using subclasses in Gtk::Builder

So it turns out that the following won’t work:

require ‘gtk2’
MyWindow = Class.new(Gtk::Window)
builder = Gtk::Builder.new
builder << EOI

<?xml version="1.0"?> 250 440 Main EOI builder['main'].show_all Gtk.main

as GLib can’t find MyWindow. Is there a way to have Gtk::Builder load
classes created in Ruby, specifically those that simply sub-class Gtk
classes?