From: Sean O'D. <se...@ce...> - 2004-02-05 06:58:30
|
Is anyone interested in this patch? I don't want to just throw it to the mailing list, but I needed this and I thought perhaps others would as well. This is just for yaml4r. It lets you load scalars as any native type you choose based on a scalars value, and is completely aside from the specification. This is just a library feature; if you use it, you completely override how native objects are loaded. If you handle loading a scalar, the Ruby native types and the explicit typing mechanisms are bypassed utterly. It lets you use syntax like this: YAML.add_implicit_transfer_handler(/^ohyeah$/) do | val | true end ...so any scalars with a raw string value of "ohyeah" are turned into the native Ruby type "true." Should I just post the patch to the mailing list? It's small at 7KB. Sean O'Dell |