text(obj, width=obj.length)
public
This adds obj as a text of
width columns in width.
If width is not specified, obj.length is used.
Show source
def text(obj, width=obj.length)
if @buffer.empty?
@output << obj
@output_width += width
else
text = @buffer.last
unless Text === text
text = Text.new
@buffer << text
end
text.add(obj, width)
@buffer_width += width
break_outmost_groups
end
end