summaryrefslogtreecommitdiff
path: root/lib/rexml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml')
-rw-r--r--lib/rexml/text.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb
index 90099f4566..0e45265a17 100644
--- a/lib/rexml/text.rb
+++ b/lib/rexml/text.rb
@@ -186,8 +186,12 @@ module REXML
# Appends text to this text node. The text is appended in the +raw+ mode
# of this text node.
+ #
+ # +returns+ the text itself to enable method chain like
+ # 'text << "XXX" << "YYY"'.
def <<( to_append )
@string << to_append.gsub( /\r\n?/, "\n" )
+ self
end