Exception: RVM::Interpreter::ReturnException
- Inherits:
-
Exception
- Object
- Exception
- RVM::Interpreter::ReturnException
- Defined in:
- lib/rvm/interpreter.rb
Overview
This is an exception designed to handle the return statement. It is thrown for for the return and the value can be evaluated.
The catching is handled bythe RVM::Classes::Block
class.
Instance Attribute Summary collapse
-
#pos ⇒ Object
readonly
Returns the value of attribute pos.
-
#val ⇒ Object
readonly
Returns the value of attribute val.
Instance Method Summary collapse
-
#initialize(val, pos = nil) ⇒ ReturnException
constructor
The ReturnException is initialized wiht 1 to 2 parameters.
Constructor Details
#initialize(val, pos = nil) ⇒ ReturnException
The ReturnException is initialized wiht 1 to 2 parameters.
- val
-
The value that will be returned, aka the part after ‘return’.
- pos
-
The position within the source code of the definition - for deugging purpose.
803 804 805 806 807 |
# File 'lib/rvm/interpreter.rb', line 803 def initialize val, pos = nil super() @val = val @pos = pos end |
Instance Attribute Details
#pos ⇒ Object (readonly)
Returns the value of attribute pos.
795 796 797 |
# File 'lib/rvm/interpreter.rb', line 795 def pos @pos end |
#val ⇒ Object (readonly)
Returns the value of attribute val.
794 795 796 |
# File 'lib/rvm/interpreter.rb', line 794 def val @val end |