Class: Gem::OptionParser::Switch::PlacedArgument
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
Gem::OptionParser::Switch
|
Defined in: | lib/rubygems/vendor/optparse/lib/optparse.rb |
Overview
::Gem::OptionParser::Switch
that takes an argument, which does not begin with ‘-’ or is ‘-’.
Class Method Summary
::Gem::OptionParser::Switch
- Inherited
.guess | Guesses argument style from #arg. |
.incompatible_argument_styles, .new, .pattern |
Instance Attribute Summary
Instance Method Summary
-
#parse(arg, argv, &error)
Returns nil if argument is not present or begins with ‘-’ and is not ‘-’.
- #pretty_head Internal use only
::Gem::OptionParser::Switch
- Inherited
#summarize | Produces the summary text. |
#switch_name | Main name of the switch. |
#add_banner, #compsys, #match_nonswitch?, #pretty_print, #pretty_print_contents, | |
#conv_arg | |
#parse_arg |
Constructor Details
This class inherits a constructor from Gem::OptionParser::Switch
Instance Method Details
#parse(arg, argv, &error)
Returns nil if argument is not present or begins with ‘-’ and is not ‘-’.
# File 'lib/rubygems/vendor/optparse/lib/optparse.rb', line 775
def parse(arg, argv, &error) if !(val = arg) and (argv.empty? or /\A-./ =~ (val = argv[0])) return nil, block, nil end opt = (val = parse_arg(val, &error))[1] val = conv_arg(*val) if opt and !arg argv.shift else val[0] = nil end val end
#pretty_head
This method is for internal use only.
[ GitHub ]
# File 'lib/rubygems/vendor/optparse/lib/optparse.rb', line 789
def pretty_head # :nodoc: "Placed" end