Class: RainforestRubyRuntime::Variables::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/rainforest_ruby_runtime/variables/registry.rb

Instance Method Summary collapse

Constructor Details

#initialize(variables = {}) ⇒ Registry

Returns a new instance of Registry.



4
5
6
# File 'lib/rainforest_ruby_runtime/variables/registry.rb', line 4

def initialize(variables = {})
  @variables = {}
end

Instance Method Details

#[](name) ⇒ Object



16
17
18
# File 'lib/rainforest_ruby_runtime/variables/registry.rb', line 16

def [](name)
  variables[name]
end

#has_variable?(name) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/rainforest_ruby_runtime/variables/registry.rb', line 12

def has_variable?(name)
  variables.has_key?(name)
end

#register(variable) ⇒ Object



8
9
10
# File 'lib/rainforest_ruby_runtime/variables/registry.rb', line 8

def register(variable)
  variables[variable.name] = variable
end