Class: TextDoc::WriterWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/libisi/doc/text.rb

Instance Method Summary collapse

Constructor Details

#initialize(writer, depth) ⇒ WriterWrapper

Returns a new instance of WriterWrapper.



82
83
84
85
# File 'lib/libisi/doc/text.rb', line 82

def initialize(writer, depth)
  @w = writer
  @d = (depth or 0).to_i
end

Instance Method Details

#<<(text) ⇒ Object



86
87
88
89
90
91
92
# File 'lib/libisi/doc/text.rb', line 86

def <<(text)
  #$log.debug("Write: #{text}")
  raise "text is nil" if text.nil?
#      STDOUT << ("\n" + text.inspect + "\n")
  text = text.to_s.gsub(/^/m,(" " * @d))
  @w << text
end