method
indent_text
indent_text(string, level=1, style="\t", indentfirstline=true)
public
Hide source
# File lib/rexml/text.rb, line 202 def indent_text(string, level=1, style="\t", indentfirstline=true) return string if level < 0 new_string = '' string.each { |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