From: Eric Armstrong Date: 2006-07-14T10:41:36+09:00 Subject: Re: Initialize a variable in an extended class Yes! That is indeed clever. I overlooked the extend method. I'm probababy going to be kicking myself for not figuring out the rest of the solution, but I'll ask anyway: What's the best way to share TAGS between this module and my main module? Also: Where is the best place to read about modules. I have yet to grok their essence, as shown by this example and my HTree question! ara.t.howard@noaa.gov wrote: > On Fri, 14 Jul 2006, Eric Armstrong wrote: > > >> d) Do some other clever thing with closures or eval, >> so the Element object can reference data defined >> in my class? Is there a way to do that? > > why not a module? > > module ElementExtension > TAGS = %w( i p foo bar ) > > def inline? > TAGS.include? name > end > end > > REXML::Element.extend ElementExtension > > > -a