/** * call-seq: * URIClassifier.new -> URIClassifier * * Initializes a new URIClassifier object that you can use to associate URI sequences * with objects. You can actually use it with any string sequence and any objects, * but it's mostly used with URIs. * * It uses TST from http://www.octavian.org/cs/software.html to build an ternary search * trie to hold all of the URIs. It uses this to do an initial search for the a URI * prefix, and then to break the URI into SCRIPT_NAME and PATH_INFO portions. It actually * will do two searches most of the time in order to find the right handler for the * registered prefix portion. * */ VALUE URIClassifier_init(VALUE self) { VALUE hash; // we create an internal hash to protect stuff from the GC hash = rb_hash_new(); rb_ivar_set(self, id_handler_map, hash); return self; }