summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych/nodes
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/lib/psych/nodes')
-rw-r--r--ext/psych/lib/psych/nodes/node.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/psych/lib/psych/nodes/node.rb b/ext/psych/lib/psych/nodes/node.rb
index 2a5573a2bd..0cefe44e44 100644
--- a/ext/psych/lib/psych/nodes/node.rb
+++ b/ext/psych/lib/psych/nodes/node.rb
@@ -40,13 +40,14 @@ module Psych
# Convert this node to YAML.
#
# See also Psych::Visitors::Emitter
- def to_yaml io = nil, options = {}
+ def yaml io = nil, options = {}
real_io = io || StringIO.new(''.encode('utf-8'))
Visitors::Emitter.new(real_io, options).accept self
return real_io.string unless io
io
end
+ alias :to_yaml :yaml
end
end
end