The base class for any Node in a YAML parse tree. This class should never be instantiated.
Create a new Psych::Nodes::Node
# File psych/lib/psych/nodes/node.rb, line 32 def initialize @children = [] end
# File psych/lib/psych/nodes/node.rb, line 66 def alias?; false; end
# File psych/lib/psych/nodes/node.rb, line 67 def document?; false; end
Iterate over each node in the tree. Yields each node to block
depth first.
# File psych/lib/psych/nodes/node.rb, line 39 def each &block return enum_for :each unless block_given? Visitors::DepthFirst.new(block).accept self end
# File psych/lib/psych/nodes/node.rb, line 68 def mapping?; false; end
# File psych/lib/psych/nodes/node.rb, line 69 def scalar?; false; end
# File psych/lib/psych/nodes/node.rb, line 70 def sequence?; false; end
# File psych/lib/psych/nodes/node.rb, line 71 def stream?; false; end
Convert this node to Ruby.
See also Psych::Visitors::ToRuby
# File psych/lib/psych/nodes/node.rb, line 48 def to_ruby Visitors::ToRuby.create.accept(self) end
Convert this node to YAML.
See also Psych::Visitors::Emitter
# File psych/lib/psych/nodes/node.rb, line 57 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