Class: OptionParser::Switch::OptionalArgument
- Inherits:
-
OptionParser::Switch
- Object
- OptionParser::Switch
- OptionParser::Switch::OptionalArgument
- Defined in:
- opal/stdlib/optparse.rb
Overview
Switch that can omit argument.
Instance Attribute Summary
Attributes inherited from OptionParser::Switch
#arg , #block , #conv , #desc , #long , #pattern , #short
Instance Method Summary collapse
-
#parse(arg, argv, &error) ⇒ Object
Parses argument if given, or uses default value.
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, &error) ⇒ Object
Parses argument if given, or uses default value.
722 723 724 725 726 727 728
# File 'opal/stdlib/optparse.rb', line 722 def parse(arg, argv, &error) if arg conv_arg(*parse_arg(arg, &error)) else conv_arg(arg) end end