Module: AbstractReflection::CompilerMirror
- Includes:
- Mirror
- Defined in:
- lib/abstract_reflection/compiler_mirror.rb
Overview
Reflecting on the compiler, both in a general sense (to just compile things) and in specific states. It should be possible to get a compiler instance and associated state from e.g. the execution of a thread.
This class should also allow access to information about JIT, caches etc
Instance Attribute Summary
Attributes included from Mirror
Instance Method Summary collapse
-
#compile(source) ⇒ Object
Your Kernel#eval, but only compiles and returns the compiled method object.
-
#module_scope ⇒ Object
For a specific compiler state, this holds the current module definition stack.
Methods included from Mirror
#initialize, #mirrors?, #name, #reflectee
Methods included from Mirror::ClassMethods
#included, #mirror_class, #new, #reflect, #reflect!, #reflects?, #register_mirror
Instance Method Details
#compile(source) ⇒ Object
Your Kernel#eval, but only compiles and returns the compiled method object.
return [MethodMirror]
16 17 18 |
# File 'lib/abstract_reflection/compiler_mirror.rb', line 16 def compile(source) raise CapabilitiesExceeded end |
#module_scope ⇒ Object
For a specific compiler state, this holds the current module definition stack. This should be a list of modules in which the Thread, that belongs to this compiler state, is currently nested. The first element is the module that would be target for the next method definition.
return [Array<ClassMirror>]
27 28 29 |
# File 'lib/abstract_reflection/compiler_mirror.rb', line 27 def module_scope raise CapabilitiesExceeded end |