Class: Rucas::Scope
Overview
Scope storing currently declared variables.
Note: You can do this using any class; just include the Symbolic module.
Constant Summary
Constants included from Symbolic
Rucas::Symbolic::BINARY_OPS, Rucas::Symbolic::CONST_CLASSES, Rucas::Symbolic::UNARY_OPS
Instance Method Summary collapse
-
#rucas(&block) ⇒ Object
Evaluate given block in this scope.
-
#subscope ⇒ Object
Create a subscope; this is just a clone of the current scope, so it includes all of the symbols of this scope.
Methods included from Symbolic
Instance Method Details
#rucas(&block) ⇒ Object
Evaluate given block in this scope.
32 33 34 |
# File 'lib/rucas.rb', line 32 def rucas &block self.instance_eval(&block) end |
#subscope ⇒ Object
Create a subscope; this is just a clone of the current scope, so it includes all of the symbols of this scope.
25 26 27 |
# File 'lib/rucas.rb', line 25 def subscope self.clone end |