Returns the version of libyaml being used
Iterate over each node in the tree. Yields each node to block
depth first.
Convert path
string to a class
Emit a map. The coder will be yielded to the block.
Emit a scalar with value
Emit a map with value
Emit a sequence of list
Called when an alias is found to anchor
. anchor
will be the name of the anchor found.
Here we have an example of an array that references itself in YAML:
--- &ponies - first element - *ponies
&ponies is the anchor, *ponies is the alias. In this case, alias is called with “ponies”.
Called when a scalar value
is found. The scalar may have an anchor
, a tag
, be implicitly plain
or implicitly quoted
value
is the string value of the scalar anchor
is an associated anchor or nil tag
is an associated tag or nil plain
is a boolean value quoted
is a boolean value style
is an integer indicating the string style
See the constants in Psych::Nodes::Scalar
for the possible values of style
Here is a YAML
document that exercises most of the possible ways this method can be called:
--- - !str "foo" - &anchor fun - many lines - | many newlines
The above YAML
document contains a list with four strings. Here are the parameters sent to this method in the same order:
# value anchor tag plain quoted style ["foo", nil, "!str", false, false, 3 ] ["fun", "anchor", nil, true, false, 1 ] ["many lines", nil, nil, true, false, 1 ] ["many\nnewlines\n", nil, nil, false, true, 4 ]
Called when an empty event happens. (Which, as far as I can tell, is never).
Is this handler a streaming handler?
Creates a new Psych::Parser
instance with handler
. YAML
events will be called on handler
. See Psych::Parser
for more details.
Parse the YAML
document contained in yaml
. Events will be called on the handler set on the parser instance.
See Psych::Parser
and Psych::Parser#handler
Returns a Psych::Parser::Mark
object that contains line, column, and index information.
Create a new scanner
Tokenize string
returning the Ruby object