method
wrap
wrap(string, width)
private
Hide source
# File lib/rexml/formatters/pretty.rb, line 129 def wrap(string, width) parts = [] while string.length > width and place = string.rindex(' ', width) parts << string[0...place] string = string[place+1..-1] end parts << string parts.join("\n") end