# OptionParser::Switch::ParseError (Class)

In: | optparse.rb
Parent: | RuntimeError

## Methods

inspect message new reason recover set_option to_s to_str

## Constants

Reason | = | 'parse error'.freeze

## Attributes

args | [R] |
reason | [W] |

## Public Class methods

new(*args)

[Source]

    # File optparse.rb, line 1597
        def initialize(*args)
          @args = args
          @reason = nil
        end

## Public Instance methods

recover(argv)

[Source]

    # File optparse.rb, line 1605
        def recover(argv)
          argv[0, 0] = @args
          argv
        end

set_option(opt, eq)

[Source]

    # File optparse.rb, line 1610
        def set_option(opt, eq)
          if eq
            @args[0] = opt
          else
            @args.unshift(opt)
          end
          self
        end

reason()

[Source]

    # File optparse.rb, line 1619
        def reason
          @reason || self.class::Reason
        end

inspect()

[Source]

    # File optparse.rb, line 1623
        def inspect
          "#<#{self.class.to_s}: #{args.join(' ')}>"
        end

message()

[Source]

    # File optparse.rb, line 1627
        def message
          reason + ': ' + args.join(' ')
        end

to_s()

Alias for message

to_str()

Alias for message

[Validate]