From: Brian Candler Date: 2003-03-18T08:50:49+09:00 Subject: Re: Question about Amrita On Mon, Mar 17, 2003 at 01:20:38PM +0900, makotz wrote: > > sample/tour/proc.rb in the Amrita distribution does what you want, setting > > element attributes explicitly. See section entitled "proc" at: > > http://www.brain-tokyo.jp/research/amrita/rdocs/files/docs/Tour.html > > I have read it. It is hard for me to understand. > > ---------------------------------------- > t = TemplateText.new < > > > >
> END > > links = [ > Proc.new {|elem| elem[:class]="odd"; ...what to do?...; elem }, > Proc.new {|elem| elem[:class]="even"; ...what to do?...; elem }, > Proc.new {|elem| elem[:class]="odd"; ...what to do?...; elem }, links = [ {:lang=>proc {|elem| elem[:class] = "odd"; elem.set_text("ruby"); elem } }, {:lang=>proc {|elem| elem[:class] = "even"; elem.set_text("python"); elem } }, {:lang=>proc {|elem| elem[:class] = "odd"; elem.set_text("perl"); elem } }, ] Regards, Brian.