const_missing/method_missing and weird names

Can I somehow convince Ruby to let me use const_missing or method_missing to catch names like 2d20? Not that I want to pile one layer of geekiness upon another, but I’d like to create a nice little DSL for dice rolls and other D&D stuff, but 2d20 isn’t a legal name for a variable or constant cos it starts with a number.

Any ideas?

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>