Module: Erubis::StringIOEnhancer

Included in:
StringIOEruby
Defined in:
lib/erubis/enhancer.rb

Overview

use StringIO class for buffering

this is only for Eruby.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descObject

:nodoc:



229
230
231
# File 'lib/erubis/enhancer.rb', line 229

def self.desc   # :nodoc:
  "use a StringIO object for buffering"
end

Instance Method Details

#add_postamble(src) ⇒ Object



237
238
239
240
# File 'lib/erubis/enhancer.rb', line 237

def add_postamble(src)
  src << "\n" unless src[-1] == ?\n
  src << "#{@bufvar}.string\n"
end

#add_preamble(src) ⇒ Object



233
234
235
# File 'lib/erubis/enhancer.rb', line 233

def add_preamble(src)
  src << "#{@bufvar} = StringIO.new;"
end