class RainforestRubyRuntime::Variables::StaticVariableRegistry

Public Class Methods

new(variables) click to toggle source
# File lib/rainforest_ruby_runtime/variables/registry.rb, line 26
def initialize(variables)
  @variables = variables.inject({}) do |variables, (name, var_and_values)|
    scope = Scope.new(name)
    var_and_values.each do |name, value|
      scope.define_variable(name.to_sym) { value }
    end
    variables[name] = scope
    variables
  end
end

Public Instance Methods

[](name) click to toggle source
# File lib/rainforest_ruby_runtime/variables/registry.rb, line 41
def [](name)
  @variables[name.to_s]
end
has_variable?(name) click to toggle source
# File lib/rainforest_ruby_runtime/variables/registry.rb, line 37
def has_variable?(name)
  @variables.has_key?(name.to_s)
end
register(*) click to toggle source
# File lib/rainforest_ruby_runtime/variables/registry.rb, line 45
def register(*)
  # noop
end