instance method
Psych::Handler#start_document
start_document(version, tag_directives, implicit)
ext/psych/lib/psych/handler.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/ext/psych/lib/psych/handler.rb, line 72
def start_document version, tag_directives, implicit
end
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.
Example
Given the following YAML:
%YAML 1.1 %TAG ! tag:tenderlovemaking.com,2009: --- !squee
The parameters for start_document must be this:
Example
version # => [1, 1] tag_directives # => [["!", "tag:tenderlovemaking.com,2009:"]] implicit # => false
See also
#scalar
#start_mapping
#event_location
#start_sequence
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0