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:
Attributes
| [RW] | implicit | Was this document implicitly created? |
| [RW] | implicit_end | Is the end of the document implicit? |
| [RW] | tag_directives | A list of tag directives for this document |
| [RW] | version | The version of the |
Class Public methods
new(version = [], tag_directives = [], implicit = false) Link
Create a new Psych::Nodes::Document object.
version is a list indicating the YAML version. tags_directives is a list of tag directive declarations implicit is a flag indicating whether the document will be implicitly started.
Example:
This creates a YAML document object that represents a YAML 1.1 document with one tag directive, and has an implicit start:
Psych::Nodes::Document.new(
[1,1],
[["!", "tag:tenderlovemaking.com,2009:"]],
true
)
See Also
See also Psych::Handler#start_document
Instance Public methods
document?() Link
root() Link
Returns the root node. A Document may only have one root node: yaml.org/spec/1.1/#id898031