method
accept
ruby latest stable - Class:
List
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v1_8_7_330) is shown here.
accept(t, pat = /.*/nm, &block)public
See OptionParser.accept.
# File lib/optparse.rb, line 530
def accept(t, pat = /.*/nm, &block)
if pat
pat.respond_to?(:match) or raise TypeError, "has no `match'"
else
pat = t if t.respond_to?(:match)
end
unless block
block = pat.method(:convert).to_proc if pat.respond_to?(:convert)
end
@atype[t] = [pat, block]
end