Skip to content

Commit

Permalink
* lib/psych.rb: specify in rdoc what object is returned in parser
Browse files Browse the repository at this point in the history
  By Adam Stankiewicz [Github Fixes #133]
  • Loading branch information
Zachary Scott committed Mar 1, 2013
1 parent 03659ce commit edf05c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Fri Mar 1 09:15:00 2013 Zachary Scott <zachary@zacharyscott.net>

* lib/psych.rb: specify in rdoc what object is returned in parser
By Adam Stankiewicz [Github Fixes #133]

Fri Mar 1 03:22:00 2013 Zachary Scott <zachary@zacharyscott.net>

* lib/psych.rb: rdoc for Psych overview by Adam Stankiewicz
Expand Down
8 changes: 4 additions & 4 deletions lib/psych.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,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")
Expand All @@ -278,7 +278,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
Expand All @@ -294,7 +294,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.
Expand Down

0 comments on commit edf05c9

Please sign in to comment.