class PrettyPrint::Text
Attributes
width[R]
Public Class Methods
new()
click to toggle source
# File lib/prettyprint.rb, line 260 def initialize @objs = [] @width = 0 end
Public Instance Methods
add(obj, width)
click to toggle source
# File lib/prettyprint.rb, line 271 def add(obj, width) @objs << obj @width += width end
output(out, output_width)
click to toggle source
# File lib/prettyprint.rb, line 266 def output(out, output_width) @objs.each {|obj| out << obj} output_width + @width end