123456789_123456789_123456789_123456789_123456789_

Class: Gem::OptionParser::Switch::RequiredArgument

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.

Class Method Summary

Instance Attribute Summary

Instance Method Summary

::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

Parses argument, converts and returns #arg, #block and result of conversion.

#parse_arg

Parses #arg and returns rest of #arg and matched portion to the argument pattern.

Constructor Details

This class inherits a constructor from Gem::OptionParser::Switch

Instance Method Details

#parse(arg, argv)

Raises an exception if argument is not present.

[ GitHub ]

  
# File 'lib/rubygems/vendor/optparse/lib/optparse.rb', line 733

def parse(arg, argv)
  unless arg
    raise MissingArgument if argv.empty?
    arg = argv.shift
  end
  conv_arg(*parse_arg(arg, &method(:raise)))
end

#pretty_head

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubygems/vendor/optparse/lib/optparse.rb', line 741

def pretty_head           # :nodoc:
  "Required"
end