class OptionParser::Switch
Individual switch class. Not important to the user.
Defined within Switch are several Switch-derived classes: NoArgument, RequiredArgument, etc.
Public Class Methods
(untyped arg) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1573
def self.guess: (untyped arg) -> untyped
Guesses argument style from arg. Returns corresponding OptionParser::Switch class (OptionalArgument, etc.).
(untyped arg, untyped t) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1580
def self.incompatible_argument_styles: (untyped arg, untyped t) -> untyped
(?untyped pattern, ?untyped conv, ?untyped short, ?untyped long, ?untyped arg, ?untyped desc, ?untyped block) { (*untyped) → untyped } → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1658
def initialize: (?untyped pattern, ?untyped conv, ?untyped short, ?untyped long, ?untyped arg, ?untyped desc, ?untyped block) { (*untyped) -> untyped } -> void
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1587
def self.pattern: () -> untyped
Public Instance Methods
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1591
def arg: () -> untyped
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1593
def block: () -> untyped
(untyped sdone, untyped ldone) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1595
def compsys: (untyped sdone, untyped ldone) -> untyped
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1597
def conv: () -> untyped
(untyped arg, ?untyped val) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1651
def conv_arg: (untyped arg, ?untyped val) -> untyped
Parses argument, converts and returns arg, block and result of conversion. Yields at semi-error condition instead of raising an exception.
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1599
def desc: () -> untyped
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1601
def long: () -> untyped
(untyped str) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1603
def match_nonswitch?: (untyped str) -> untyped
(untyped arg) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1667
def parse_arg: (untyped arg) -> untyped
Parses arg and returns rest of arg and matched portion to the argument pattern. Yields when the pattern doesnβt match substring.
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1605
def pattern: () -> untyped
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1607
def short: () -> untyped
(?untyped sdone, ?untyped ldone, ?untyped width, ?untyped max, ?untyped indent) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1632
def summarize: (?untyped sdone, ?untyped ldone, ?untyped width, ?untyped max, ?untyped indent) -> untyped
Produces the summary text. Each line of the summary is yielded to the block (without newline).
sdone-
Already summarized short style options keyed hash.
ldone-
Already summarized long style options keyed hash.
width-
Width of left side (option part). In other words, the right side (description part) starts after
widthcolumns. max-
Maximum width of left side -> the options are filled within
maxcolumns. indent-
Prefix string indents all summarized lines.
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/optparse/0/optparse.rbs, line 1640
def switch_name: () -> untyped
Main name of the switch.