Exception: RVM::Interpreter::RuntimeError
- Inherits:
-
Exception
- Object
- Exception
- RVM::Interpreter::RuntimeError
- Defined in:
- lib/rvm/interpreter.rb
Instance Attribute Summary collapse
-
#char ⇒ Object
Returns the value of attribute char.
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#line ⇒ Object
Returns the value of attribute line.
-
#total ⇒ Object
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(message, total = nil, line = nil, char = nil) ⇒ RuntimeError
constructor
A new instance of RuntimeError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, total = nil, line = nil, char = nil) ⇒ RuntimeError
Returns a new instance of RuntimeError.
23 24 25 26 27 28 29 |
# File 'lib/rvm/interpreter.rb', line 23 def initialize , total = nil, line = nil, char = nil super() @line = line @char = char @total = total @error_message = end |
Instance Attribute Details
#char ⇒ Object
Returns the value of attribute char.
22 23 24 |
# File 'lib/rvm/interpreter.rb', line 22 def char @char end |
#error_message ⇒ Object
Returns the value of attribute error_message.
22 23 24 |
# File 'lib/rvm/interpreter.rb', line 22 def @error_message end |
#line ⇒ Object
Returns the value of attribute line.
22 23 24 |
# File 'lib/rvm/interpreter.rb', line 22 def line @line end |
#total ⇒ Object
Returns the value of attribute total.
22 23 24 |
# File 'lib/rvm/interpreter.rb', line 22 def total @total end |
Instance Method Details
#to_s ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/rvm/interpreter.rb', line 31 def to_s res = "Runtime error" if @total or @line res << " at" end if @total res << " character #{@total}" end if @line res << " line #{@line}" end if @char res << ":#{@char}" end res << ": #{@error_message}" res end |