This class represents a YAML Alias. It points to an anchor
.
A Psych::Nodes::Alias
is a terminal node and may have no children.
This represents a YAML Document
. This node must be a child of Psych::Nodes::Stream
. A Psych::Nodes::Document
must have one child, and that child may be one of the following:
This class represents a YAML Mapping.
A Psych::Nodes::Mapping
node may have 0 or more children, but must have an even number of children. Here are the valid children a Psych::Nodes::Mapping
node may have:
The base class for any Node
in a YAML parse tree. This class should never be instantiated.
This class represents a YAML Scalar.
This node type is a terminal node and should not have any children.
This class represents a YAML sequence.
A YAML sequence is basically a list, and looks like this:
%YAML 1.1 --- - I am - a Sequence
A YAML sequence may have an anchor like this:
%YAML 1.1 --- &A [ "This sequence", "has an anchor" ]
A YAML sequence may also have a tag like this:
%YAML 1.1 --- !!seq [ "This sequence", "has a tag" ]
This class represents a sequence in a YAML document. A Psych::Nodes::Sequence
node may have 0 or more children. Valid children for this node are:
Represents a YAML stream. This is the root node for any YAML parse tree. This node must have one or more child nodes. The only valid child node for a Psych::Nodes::Stream
node is Psych::Nodes::Document
.
This class walks a YAML AST, converting each node to Ruby
YAMLTree
builds a YAML ast given a Ruby object. For example:
builder = Psych::Visitors::YAMLTree.new builder << { :foo => 'bar' } builder.tree # => #<Psych::Nodes::Stream .. }