Class: Rucas::Scope

Inherits:
Object
  • Object
show all
Includes:
Symbolic
Defined in:
lib/rucas.rb

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

Methods included from Symbolic

#var

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

#subscopeObject

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