Class: RVM::Interpreter::VariableStorage
- Inherits:
-
Object
- Object
- RVM::Interpreter::VariableStorage
- Defined in:
- lib/rvm/environment.rb
Overview
This class is used to store the variable content to allow chross refferencing and passing variables upwards through different scopes.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#val ⇒ Object
Lets the script read the value of the variable.
Instance Method Summary collapse
-
#initialize(val = nil, writable = true) ⇒ VariableStorage
constructor
The storage is initialized with two optional parameters:.
Constructor Details
#initialize(val = nil, writable = true) ⇒ VariableStorage
The storage is initialized with two optional parameters:
val
-
which is the value to be stores.
writable
-
which when set to false prevents the variable to be written, which might be helpfull when trying to publish some data to a script that is not supposed to be changed.
203 204 205 206 |
# File 'lib/rvm/environment.rb', line 203 def initialize val = nil, writable = true @writable = writable @val = val end |
Instance Attribute Details
#val ⇒ Object
Lets the script read the value of the variable.
195 196 197 |
# File 'lib/rvm/environment.rb', line 195 def val @val end |