class Gem::OptionParser::List
def update(sw, sopts, lopts, nsw = nil, nlopts = nil) # :nodoc:
+nlopts+:: Negated long style options list.
+lopts+:: Long style option list.
+sopts+:: Short style option list.
+sw+:: Gem::OptionParser::Switch instance to be added.
Adds +sw+ according to +sopts+, +lopts+ and +nlopts+.
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 used = @short.invert.update(@long.invert) @list.delete_if {|o| Switch === o and !used[o]} end