End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
OptionParser::Switch#conv_arg
conv_arg(arg, val = [])
lib/optparse.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/optparse.rb, line 575
def conv_arg(arg, val = [])
if conv
val = conv.call(*val)
else
val = proc {|v| v}.call(*val)
end
return arg, block, val
end
Parses argument, converts and returns arg, block and result of conversion. Yields at semi-error condition instead of raising an exception.