summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2024-02-23 21:49:57 +0900
committergit <svn-admin@ruby-lang.org>2024-02-23 12:50:08 +0000
commit7da3f8dcd34a58ce806cf2d8b22edb3261dea131 (patch)
treeecdd5dee5c87a7fccb51b1fb0a5d0fdd4e8905c8
parentf0172fc7ee9f0c27cb543f52deae477c9ada4c79 (diff)
[ruby/optparse] [DOC] About return value of OptionParser#new
https://github.com/ruby/optparse/commit/59b9fd7ddc
-rw-r--r--lib/optparse.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index 08abca220f..51dbfd0ad2 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -1216,9 +1216,9 @@ XXX
#
# Directs to reject specified class argument.
#
- # +t+:: Argument class specifier, any object including Class.
+ # +type+:: Argument class specifier, any object including Class.
#
- # reject(t)
+ # reject(type)
#
def reject(*args, &blk) top.reject(*args, &blk) end
#
@@ -1347,6 +1347,9 @@ XXX
#
# Pushes a new List.
#
+ # If a block is given, yields +self+ and returns the result of the
+ # block, otherwise returns +self+.
+ #
def new
@stack.push(List.new)
if block_given?
@@ -1570,6 +1573,12 @@ XXX
nolong
end
+ # ----
+ # Option definition phase methods
+ #
+ # These methods are used to define options, or to construct an
+ # OptionParser instance in other words.
+
# :call-seq:
# define(*params, &block)
#
@@ -1645,6 +1654,13 @@ XXX
top.append(string, nil, nil)
end
+ # ----
+ # Arguments parse phase methods
+ #
+ # These methods parse +argv+, convert, and store the results by
+ # calling handlers. As these methods do not modify +self+, +self+
+ # can be frozen.
+
#
# Parses command line arguments +argv+ in order. When a block is given,
# each non-option argument is yielded. When optional +into+ keyword