Class: RainforestRubyRuntime::Variables::Scope
- Defined in:
- lib/rainforest_ruby_runtime/variables/scope.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #define_variable(name, &block) ⇒ Object
-
#initialize(&block) ⇒ Scope
constructor
A new instance of Scope.
- #method_missing(name, *args, &block) ⇒ Object
Methods inherited from Value
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/rainforest_ruby_runtime/variables/scope.rb', line 16 def method_missing(name, *args, &block) if @registry.has_variable?(name) @registry[name].call *args, &block else super end end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
4 5 6 |
# File 'lib/rainforest_ruby_runtime/variables/scope.rb', line 4 def block @block end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/rainforest_ruby_runtime/variables/scope.rb', line 4 def name @name end |