Skip to content

Commit

Permalink
Be specific what parse method returns
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerun committed Feb 27, 2013
1 parent 0b72234 commit f1ce953
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/psych.rb
Expand Up @@ -131,15 +131,15 @@ def self.load yaml, filename = nil
end 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 # +filename+ is used in the exception message if a Psych::SyntaxError is
# raised. # raised.
# #
# Raises a Psych::SyntaxError when a YAML syntax error is detected. # Raises a Psych::SyntaxError when a YAML syntax error is detected.
# #
# Example: # Example:
# #
# Psych.parse("---\n - a\n - b") # => #<Psych::Nodes::Sequence:0x00> # Psych.parse("---\n - a\n - b") # => #<Psych::Nodes::Document:0x00>
# #
# begin # begin
# Psych.parse("--- `", "file.txt") # Psych.parse("--- `", "file.txt")
Expand All @@ -157,7 +157,7 @@ def self.parse yaml, filename = nil
end 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. # Raises a Psych::SyntaxError when a YAML syntax error is detected.
def self.parse_file filename def self.parse_file filename
Expand All @@ -173,7 +173,7 @@ def self.parser
end 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+. # This method can handle multiple YAML documents contained in +yaml+.
# +filename+ is used in the exception message if a Psych::SyntaxError is # +filename+ is used in the exception message if a Psych::SyntaxError is
# raised. # raised.
Expand Down

0 comments on commit f1ce953

Please sign in to comment.