Class: OptionParser::Switch::RequiredArgument
- Inherits:
-
OptionParser::Switch
- Object
- OptionParser::Switch
- OptionParser::Switch::RequiredArgument
- Defined in:
- opal/stdlib/optparse.rb
Overview
Switch that takes an argument.
Instance Attribute Summary
Attributes inherited from OptionParser::Switch
#arg , #block , #conv , #desc , #long , #pattern , #short
Instance Method Summary collapse
-
#parse(arg, argv) ⇒ Object
Raises an exception if argument is not present.
Methods inherited from OptionParser::Switch
#add_banner , #compsys , guess , incompatible_argument_styles , #initialize , #match_nonswitch? , pattern , #summarize , #switch_name
Constructor Details
This class inherits a constructor from OptionParser::Switch
Instance Method Details
#parse(arg, argv) ⇒ Object
Raises an exception if argument is not present.
706 707 708 709 710 711 712
# File 'opal/stdlib/optparse.rb', line 706 def parse(arg, argv) unless arg raise MissingArgument if argv.empty? arg = argv.shift end conv_arg(*parse_arg(arg, &method(:raise))) end