I’m building a parser class which uses a separate token class to store
regexes about to help recognize custom markup tags.
attr_reader( :start_link, :end_link, :bold )
@start_link = /[[/
@end_link = /]]/
@bold = /**/
The attr_reader line looks clumsy to me. Is there a way to get the class to
automatically allow for any instance variable to be given the attr_reader
characteristic? This list could get quite long and while I am using
Test::Unit to keep from breaking things the more I fix them. Mostly I’m
lazy and I’d prefer not to have to add a variable name in two places.
Thanks for your help.
- -michael libby