HarryO wrote:
> I
> > At any point (inside or outside a class definition), you could do:
> > 
> >   meth = "talk"   # using string interpolation just to illustrate output
> >   = "hi"
> >   Object.module_eval <<-EOE
> >     def #{meth}
> >       puts "#{output}"
> >     end
> >   EOE
> 
> Just out of interest, what's the difference between using "eval %{ ...}"
> and a "here" document as you've suggested?

%{ ... } is just a multi-line string, and I like it more than "here" documents. 
It's just a parameter to eval, nothing special.
You can use every character after the %, where ( { [ and < are special in that
they count the occurence, e.g.

%|  breaks after the first '|' |

but 

%[ counts the occurrence of '[' and ']' ] 

works.



Regards,

  Michael


-- 
Michael Neumann
merlin.zwo InfoDesign GmbH
http://www.merlin-zwo.de