Provides utility methods for the YAML 1.1 core schema with the additional independent types specified in http://yaml.org/type/
Invokes the block for each of the given nodes keys and values, resolving merge keys (<<) when found (keys and values of the resolved merge mappings are yielded, recursively).
Deserializes a YAML document.
Deserializes multiple YAML documents.
If node
parses to a null value, returns nil
, otherwise invokes the given block.
Assuming the pull_parser is positioned in a scalar, parses it according to the core schema, taking the scalar's style and tag into account, then advances the pull parser.
Parses a string according to the core schema, assuming the string had a plain style.
Parses a scalar value from the given node.
Returns whether a string is reserved and must non be output with a plain style, according to the core schema.
Invokes the block for each of the given nodes keys and values, resolving merge keys (<<) when found (keys and values of the resolved merge mappings are yielded, recursively).
Deserializes a YAML document.
Same as YAML.parse
.
Deserializes multiple YAML documents.
Same as YAML.parse_all
.
If node
parses to a null value, returns nil
, otherwise invokes the given block.
Assuming the pull_parser is positioned in a scalar, parses it according to the core schema, taking the scalar's style and tag into account, then advances the pull parser.
Parses a string according to the core schema, assuming the string had a plain style.
require "yaml" YAML::Schema::Core.parse_scalar("hello") # => "hello" YAML::Schema::Core.parse_scalar("1.2") # => 1.2 YAML::Schema::Core.parse_scalar("false") # => false
Parses a scalar value from the given node.
Returns whether a string is reserved and must non be output with a plain style, according to the core schema.
require "yaml" YAML::Schema::Core.reserved_string?("hello") # => false YAML::Schema::Core.reserved_string?("1.2") # => true YAML::Schema::Core.reserved_string?("false") # => true
© 2012–2020 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.35.1/YAML/Schema/Core.html