Skip to content

Commit

Permalink
nodoc private methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Apr 11, 2021
1 parent 7e65ef3 commit f23d750
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/optparse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ def initialize(pattern = nil, conv = nil,
# Parses +arg+ and returns rest of +arg+ and matched portion to the
# argument pattern. Yields when the pattern doesn't match substring.
#
def parse_arg(arg)
def parse_arg(arg) # :nodoc:
pattern or return nil, [arg]
unless m = pattern.match(arg)
yield(InvalidArgument, arg)
Expand All @@ -572,7 +572,7 @@ def parse_arg(arg)
# conversion. Yields at semi-error condition instead of raising an
# exception.
#
def conv_arg(arg, val = [])
def conv_arg(arg, val = []) # :nodoc:
if conv
val = conv.call(*val)
else
Expand Down Expand Up @@ -806,7 +806,7 @@ def reject(t)
# +lopts+:: Long style option list.
# +nlopts+:: Negated long style options list.
#
def update(sw, sopts, lopts, nsw = nil, nlopts = nil)
def update(sw, sopts, lopts, nsw = nil, nlopts = nil) # :nodoc:
sopts.each {|o| @short[o] = sw} if sopts
lopts.each {|o| @long[o] = sw} if lopts
nlopts.each {|o| @long[o] = nsw} if nsw and nlopts
Expand Down Expand Up @@ -1300,7 +1300,7 @@ def to_a; summarize("#{banner}".split(/^/)) end
# +prv+:: Previously specified argument.
# +msg+:: Exception message.
#
def notwice(obj, prv, msg)
def notwice(obj, prv, msg) # :nodoc:
unless !prv or prv == obj
raise(ArgumentError, "argument #{msg} given twice: #{obj}",
ParseError.filter_backtrace(caller(2)))
Expand Down Expand Up @@ -1732,7 +1732,7 @@ def self.getopts(*args)
# Traverses @stack, sending each element method +id+ with +args+ and
# +block+.
#
def visit(id, *args, &block)
def visit(id, *args, &block) # :nodoc:
@stack.reverse_each do |el|
el.__send__(id, *args, &block)
end
Expand All @@ -1743,7 +1743,7 @@ def visit(id, *args, &block)
#
# Searches +key+ in @stack for +id+ hash and returns or yields the result.
#
def search(id, key)
def search(id, key) # :nodoc:
block_given = block_given?
visit(:search, id, key) do |k|
return block_given ? yield(k) : k
Expand All @@ -1760,7 +1760,7 @@ def search(id, key)
# +icase+:: Search case insensitive if true.
# +pat+:: Optional pattern for completion.
#
def complete(typ, opt, icase = false, *pat)
def complete(typ, opt, icase = false, *pat) # :nodoc:
if pat.empty?
search(typ, opt) {|sw| return [sw, opt]} # exact match or...
end
Expand Down

0 comments on commit f23d750

Please sign in to comment.