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

[Source]

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

Public Instance methods

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Source]

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

Alias for message

to_str()

Alias for message

[Validate]