Called when the document starts with the declared version
, tag_directives
, if the document is implicit
.
version
will be an array of integers indicating the YAML
version being dealt with, tag_directives
is a list of tuples indicating the prefix and suffix of each tag, and implicit
is a boolean indicating whether the document is started implicitly.
Given the following YAML:
%YAML 1.1 %TAG ! tag:tenderlovemaking.com,2009: --- !squee
The parameters for start_document
must be this:
version # => [1, 1] tag_directives # => [["!", "tag:tenderlovemaking.com,2009:"]] implicit # => false
Called with the document ends. implicit
is a boolean value indicating whether or not the document has an implicit ending.
Given the following YAML:
--- hello world
implicit
will be true. Given this YAML:
--- hello world ...
implicit
will be false.
Called when the YAML
stream ends
Called before each event with line/column information.
Parse and return an int from string
Handles start_document
events with version
, tag_directives
, and implicit
styling.
Handles end_document
events with version
, tag_directives
, and implicit
styling.
Start a document emission with YAML
version
, tags
, and an implicit
start.
End a document emission with an implicit
ending.
Get the preferred line width.
Set
the preferred line with to width
.
Replace %w+% into the environment value of what is contained between the %‘s This method is used for REG_EXPAND_SZ.
For detail, see expandEnvironmentStrings Win32 API.
Read a REG_SZ or REG_EXPAND_SZ registry value named name.
If the value type is REG_EXPAND_SZ, environment variables are replaced. Unless the value type is REG_SZ or REG_EXPAND_SZ, TypeError
is raised.
Guesses the type of the data which have been inputed into the stream. The returned value is either BINARY
, ASCII
, or UNKNOWN
.
Returns true if the stream is finished.
Sets the preset dictionary and returns string
. This method is available just only after Zlib::Deflate.new
or Zlib::ZStream#reset
method was called. See zlib.h for details.
Can raise errors of Z_STREAM_ERROR if a parameter is invalid (such as NULL dictionary) or the stream state is inconsistent, Z_DATA_ERROR if the given dictionary doesn’t match the expected one (incorrect adler32 value)
Provide the inflate stream with a dictionary that may be required in the future. Multiple dictionaries may be provided. The inflate stream will automatically choose the correct user-provided dictionary based on the stream’s required dictionary.
Sets the preset dictionary and returns string
. This method is available just only after a Zlib::NeedDict
exception was raised. See zlib.h for details.