From: James Edward Gray II Date: 2004-10-28T06:22:00+09:00 Subject: Re: Another erb Question On Oct 27, 2004, at 4:05 PM, Jamis Buck wrote: > James Edward Gray II wrote: >> Can anyone explain the practical purpose of the final arg to >> ERB.new() to me? > > class ERB > def initialize(str, safe_level=nil, trim_mode=nil, eoutvar='_erbout') > ... > end > end > > You mean, +eoutvar+? That's the name of the variable that ERB uses > when it generates the Ruby code that corresponds to its input. That > variable will be used to build the output. > > Try this: > > require 'erb' > e = ERB.new( "One <%= ENV['HOME'] %> Two" ) > p e.src > > You'll see a variable _erbout initialized to the empty string, and > then the result of each operation concat'ed onto it. I'm with ya to there. What would you use that for? Filling a variable of your choice with the ERB source? James Edward Gray II