summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych/visitors/visitor.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-30 10:46:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-30 10:46:06 +0000
commitf1330fd12403ef4d664df7619d6ce312d525721a (patch)
treecfafd35d3d416b8529003d43db2ace98af20fdb1 /ext/psych/lib/psych/visitors/visitor.rb
parent38af94c6abaaa20aeaa1ffafbe3f6ff962f63eaa (diff)
* ext/psych/lib: moved external library dependent files from lib.
[ruby-core:29129] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/lib/psych/visitors/visitor.rb')
-rw-r--r--ext/psych/lib/psych/visitors/visitor.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/ext/psych/lib/psych/visitors/visitor.rb b/ext/psych/lib/psych/visitors/visitor.rb
new file mode 100644
index 00000000000..ccd8c3bd55e
--- /dev/null
+++ b/ext/psych/lib/psych/visitors/visitor.rb
@@ -0,0 +1,18 @@
+module Psych
+ module Visitors
+ class Visitor
+ def accept target
+ case target
+ when Psych::Nodes::Scalar then visit_Psych_Nodes_Scalar target
+ when Psych::Nodes::Mapping then visit_Psych_Nodes_Mapping target
+ when Psych::Nodes::Sequence then visit_Psych_Nodes_Sequence target
+ when Psych::Nodes::Alias then visit_Psych_Nodes_Alias target
+ when Psych::Nodes::Document then visit_Psych_Nodes_Document target
+ when Psych::Nodes::Stream then visit_Psych_Nodes_Stream target
+ else
+ raise "Can't handle #{target}"
+ end
+ end
+ end
+ end
+end