summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych/visitors/yaml_tree.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-16 02:33:05 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-16 02:33:05 +0000
commit37910b13fbc1d6831b5623368472497629b36ae9 (patch)
tree933008e12174e9108b9ab65984d80cd403d16a33 /ext/psych/lib/psych/visitors/yaml_tree.rb
parentd9615c85a370039b3d798eb04a77a6bf278c4e9e (diff)
* ext/psych/lib/psych/visitors/json_tree.rb: using factory methods for
node creation * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/lib/psych/visitors/yaml_tree.rb')
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/psych/lib/psych/visitors/yaml_tree.rb b/ext/psych/lib/psych/visitors/yaml_tree.rb
index 4c8ba295a3..608da6d1a0 100644
--- a/ext/psych/lib/psych/visitors/yaml_tree.rb
+++ b/ext/psych/lib/psych/visitors/yaml_tree.rb
@@ -151,7 +151,7 @@ module Psych
end
def visit_Integer o
- append Nodes::Scalar.new o.to_s
+ append create_scalar o.to_s
end
alias :visit_TrueClass :visit_Integer
alias :visit_FalseClass :visit_Integer
@@ -159,11 +159,11 @@ module Psych
def visit_Float o
if o.nan?
- append Nodes::Scalar.new '.nan'
+ append create_scalar '.nan'
elsif o.infinite?
- append Nodes::Scalar.new(o.infinite? > 0 ? '.inf' : '-.inf')
+ append create_scalar(o.infinite? > 0 ? '.inf' : '-.inf')
else
- append Nodes::Scalar.new o.to_s
+ append create_scalar o.to_s
end
end