From: Michael Brailsford Date: 2002-07-23T15:12:13+09:00 Subject: Re: attr_reader for great number of instance vars > I'm building a parser class which uses a separate token class to store > regexes about to help recognize custom markup tags. If these tokens are a static entity (ie. they are predefined), then you can use a Struct. In which case your Tokens class becomes: Tokens = Struct.new("Tokens", :start_link, :end_link, :bold) t = Tokens.new(/\[\[/, /\]\]/, /\*\*/) Which does the same thing as your Token class below, with the addition that the Struct also provides "attr_writer" for each attribute of the Tokens class. > class Tokens > attr_reader( :start_link, :end_link, :bold ) > def initialize > @start_link = /\[\[/ > @end_link = /\]\]/ > @bold = /\*\*/ > end > end The following is from 'ri Struct'. "A Struct is a convenient way to bundle a number of attributes together, using accessor methods, without having to write an explicit class." That seems to me to be what you want. -Michael