Module: Erubis::StringBufferEnhancer

Included in:
RubyGenerator, StringBufferEruby
Defined in:
lib/erubis/enhancer.rb

Overview

use String class for buffering

this is only for Eruby.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descObject

:nodoc:



207
208
209
# File 'lib/erubis/enhancer.rb', line 207

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

Instance Method Details

#add_postamble(src) ⇒ Object



215
216
217
218
# File 'lib/erubis/enhancer.rb', line 215

def add_postamble(src)
  src << "\n" unless src[-1] == ?\n
  src << "_buf.to_s\n"
end

#add_preamble(src) ⇒ Object



211
212
213
# File 'lib/erubis/enhancer.rb', line 211

def add_preamble(src)
  src << "_buf = '';"
end