Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Be specific what parse method returns #133

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+4 −4
Split
View
@@ -131,15 +131,15 @@ def self.load yaml, filename = nil
end
###
- # Parse a YAML string in +yaml+. Returns the first object of a YAML AST.
+ # Parse a YAML string in +yaml+. Returns the Psych::Nodes::Document.
# +filename+ is used in the exception message if a Psych::SyntaxError is
# raised.
#
# Raises a Psych::SyntaxError when a YAML syntax error is detected.
#
# Example:
#
- # Psych.parse("---\n - a\n - b") # => #<Psych::Nodes::Sequence:0x00>
+ # Psych.parse("---\n - a\n - b") # => #<Psych::Nodes::Document:0x00>
#
# begin
# Psych.parse("--- `", "file.txt")
@@ -157,7 +157,7 @@ def self.parse yaml, filename = nil
end
###
- # Parse a file at +filename+. Returns the YAML AST.
+ # Parse a file at +filename+. Returns the Psych::Nodes::Document.
#
# Raises a Psych::SyntaxError when a YAML syntax error is detected.
def self.parse_file filename
@@ -173,7 +173,7 @@ def self.parser
end
###
- # Parse a YAML string in +yaml+. Returns the full AST for the YAML document.
+ # Parse a YAML string in +yaml+. Returns the Psych::Nodes::Stream.
# This method can handle multiple YAML documents contained in +yaml+.
# +filename+ is used in the exception message if a Psych::SyntaxError is
# raised.