diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-03 21:31:43 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-03 21:31:43 +0000 |
commit | 1c60db55ac07b238d9d4e1443f5b6f8dd1fa9da0 (patch) | |
tree | 228a5a5273452b8a04ae4d07cb14198342cc646f /ext/psych/lib/psych/nodes | |
parent | bd3b0d470c12fbdb48efcdb310d00eaa0fea84e5 (diff) |
* ext/psych/lib/psych.rb: calling `yaml` rather than `to_yaml`.
* ext/psych/lib/psych/nodes/node.rb: Rename `to_yaml` to just `yaml`
in order to avoid YAML::ENGINE switching from replacing this method.
* test/psych/helper.rb: fix tests for method name change.
* test/psych/test_document.rb: ditto
* test/psych/visitors/test_emitter.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/lib/psych/nodes')
-rw-r--r-- | ext/psych/lib/psych/nodes/node.rb | 3 |
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 |