Methods
- F
-
- I
-
- M
-
- N
-
- R
-
- S
-
- T
-
Constants
Reason |
= |
'parse error' |
|
Reason which caused the error.
|
Attributes
[RW]
|
additional |
|
[R]
|
args |
|
[W]
|
reason |
|
Class Public methods
filter_backtrace(array)
Link
Source:
show
| on GitHub
def self.filter_backtrace(array)
unless $DEBUG
array.delete_if(&%r"\A#{Regexp.quote(__FILE__)}:"o.method(:=~))
end
array
end
new(*args, additional: nil)
Link
Source:
show
| on GitHub
def initialize(*args, additional: nil)
@additional = additional
@arg0, = args
@args = args
@reason = nil
end
Instance Public methods
inspect()
Link
Source:
show
| on GitHub
def inspect
"#<#{self.class}: #{args.join(' ')}>"
end
message()
Link
Default stringizing method to emit standard error message.
Source:
show
| on GitHub
def message
"#{reason}: #{args.join(' ')}#{additional[@arg0] if additional}"
end
reason()
Link
Returns error reason. Override this for I18N.
Source:
show
| on GitHub
def reason
@reason || self.class::Reason
end
recover(argv)
Link
Pushes back erred argument(s) to argv
.
Source:
show
| on GitHub
def recover(argv)
argv[0, 0] = @args
argv
end
set_backtrace(array)
Link
Source:
show
| on GitHub
def set_backtrace(array)
super(self.class.filter_backtrace(array))
end
set_option(opt, eq)
Link
Source:
show
| on GitHub
def set_option(opt, eq)
if eq
@args[0] = opt
else
@args.unshift(opt)
end
self
end