method
indent_text
indent_text(string, level=1, style="\t", indentfirstline=true)
public
Hide source
# File lib/rexml/text.rb, line 278 def indent_text(string, level=1, style="\t", indentfirstline=true) return string if level < 0 new_string = '' string.each_line { |line| indent_string = style * level new_line = (indent_string + line).sub(/[\s]+$/,'') new_string << new_line } new_string.strip! unless indentfirstline return new_string end