class RDoc::ERBIO

ERB 的一个子类,直接写入 IO。感谢 Aaron Patterson 和 Masatoshi SEKI 的贡献。

使用方法

erbio = RDoc::ERBIO.new '<%= "hello world" %>', nil, nil

File.open 'hello.txt', 'w' do |io|
  erbio.result binding
end

请注意,绑定必须包含您希望输出的 io。