From 8328623efd2889ffcd513454d914385d480cce57 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 29 Sep 2009 20:19:44 -0700 Subject: do not need blocks --- lib/psych/visitors/yast_builder.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/psych/visitors/yast_builder.rb b/lib/psych/visitors/yast_builder.rb index aad42d3..620a2bb 100644 --- a/lib/psych/visitors/yast_builder.rb +++ b/lib/psych/visitors/yast_builder.rb @@ -20,15 +20,15 @@ module Psych raise TypeError, "Can't dump #{target.class}" end - visitor_for(::String) do |o| + def visit_String o @stack.last.children << Nodes::Scalar.new(o) end - visitor_for(::Class) do |o| + def visit_Class o raise TypeError, "can't dump anonymous class #{o.class}" end - visitor_for(::Hash) do |o| + def visit_Hash o @stack.push append Nodes::Mapping.new o.each do |k,v| @@ -39,7 +39,7 @@ module Psych @stack.pop end - visitor_for(::Array) do |o| + def visit_Array o @stack.push append Nodes::Sequence.new o.each { |c| c.accept self } @stack.pop -- cgit v1.2.3