documentation for ParseDate

"Konrad Meyer" <[email protected]> Sat, 7 Oct 2006 15:19:19 -0700
Newsgroups gmane.comp.lang.ruby.documentation
Message-ID <[email protected]>
One module, one method. See attached.

I'd greatly appreciate comments, since this is my first effort; I
mostly tried to emulate the documentation of Ostruct, which was rated
at 10.

-- 
Conrad Meyer
parsedate.rb.patch (text/x-patch, 1.7 KB)
Index: parsedate.rb
===================================================================
RCS file: /src/ruby/lib/parsedate.rb,v
retrieving revision 1.18
diff -p -u -1 -r1.18 parsedate.rb
--- parsedate.rb	25 Aug 2006 23:06:41 -0000	1.18
+++ parsedate.rb	7 Oct 2006 22:16:41 -0000
@@ -1,3 +1,21 @@
-# parsedate.rb: Written by Tadayoshi Funaba 2001, 2002
-# $Id: parsedate.rb,v 2.6 2002-05-14 07:43:18+09 tadf Exp $
+#
+# = parsedate.rb: Parses dates
+#
+# Author:: Tadayoshi Funaba
+# Documentation:: Konrad Meyer
+#
+# ParseDate munches on a date and turns it into an array of values.
+#
+
+#
+# ParseDate converts a date into an array of values.
+# For example:
+#
+#   require 'parsedate'
+#
+#   ParseDate.parsedate "Tuesday, July 6th, 2007, 18:35:20 UTC"
+#   # => [2007, 7, 6, 18, 35, 20, "UTC", 2]
+#
+# The order is of the form [year, month, day of month, hour, minute, second,
+# timezone, day of the week].
 
@@ -6,3 +24,23 @@ require 'date/format'
 module ParseDate
-
+  #
+  # Parse a string representation of a date into values.
+  # For example:
+  #
+  #   require 'parsedate'
+  #
+  #   ParseDate.parsedate "Tuesday, July 5th, 2007, 18:35:20 UTC"
+  #   # => [2007, 7, 5, 18, 35, 20, "UTC", 2]
+  #
+  # The order is of the form [year, month, day of month, hour, minute,
+  # second, timezone, day of week].
+  #
+  # ParseDate.parsedate can also take a second argument, +comp+, which
+  # is a boolean telling the method to compensate for dates with years
+  # expressed as two digits. Example:
+  #
+  #   require 'parsedate'
+  #
+  #   ParseDate.parsedate "Mon Dec 25 00 06:53:24 UTC", true
+  #   # => [2000, 12, 25, 6, 53, 24, "UTC", 1]
+  #
   def parsedate(str, comp=false)