Class: RVM::Interpreter::VariableStorage

Inherits:
Object
  • Object
show all
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

VariableStorageCallback

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#valObject

Lets the script read the value of the variable.



195
196
197
# File 'lib/rvm/environment.rb', line 195

def val
  @val
end