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
Create a new TreeBuilder
instance
Create a new Psych::Emitter
that writes to io
.
Emit a scalar with value
, anchor
, tag
, and a plain
or quoted
string type with style
.
Get the output style, canonical or not.
Set
the output style to canonical, or not.
Get the indentation level.
Set
the indentation level to level
. The level must be less than 10 and greater than 1.
Start streaming using encoding
@api private
Load the document contained in filename
. Returns the yaml contained in filename
as a Ruby object, or if the file is empty, it returns the specified fallback
return value, which defaults to false
.
NOTE: This method *should not* be used to parse untrusted documents, such as YAML
documents that are supplied via user input. Instead, please use the safe_load_file
method.
Safely loads the document contained in filename
. Returns the yaml contained in filename
as a Ruby object, or if the file is empty, it returns the specified fallback
return value, which defaults to false
. See safe_load
for options.