Class: RainforestRubyRuntime::Variables::Registry
- Inherits:
-
Object
- Object
- RainforestRubyRuntime::Variables::Registry
- Defined in:
- lib/rainforest_ruby_runtime/variables/registry.rb
Instance Method Summary collapse
- #[](name) ⇒ Object
- #has_variable?(name) ⇒ Boolean
-
#initialize(variables = {}) ⇒ Registry
constructor
A new instance of Registry.
- #register(variable) ⇒ Object
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
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 |