Module: AbstractReflection
- Included in:
- Ruby::Reflection
- Defined in:
- lib/abstract_reflection.rb,
lib/abstract_reflection/mirror.rb,
lib/abstract_reflection/gc_mirror.rb,
lib/abstract_reflection/class_mirror.rb,
lib/abstract_reflection/field_mirror.rb,
lib/abstract_reflection/method_mirror.rb,
lib/abstract_reflection/object_mirror.rb,
lib/abstract_reflection/thread_mirror.rb,
lib/abstract_reflection/compiler_mirror.rb,
lib/abstract_reflection/stack_frame_mirror.rb
Defined Under Namespace
Modules: ClassMethods, ClassMirror, CompilerMirror, FieldMirror, GCMirror, MethodMirror, Mirror, ObjectMirror, StackFrameMirror, ThreadMirror Classes: CapabilitiesExceeded
Class Method Summary collapse
Instance Method Summary collapse
-
#classes ⇒ Array<ClassMirror>
This method can be used to query the system for known classes.
-
#engine ⇒ String
The used implementation of Ruby.
-
#implementations_of(message) ⇒ Array<MethodMirror>
Query the system for implementors of a particular message.
-
#initialize(object) ⇒ Reflection
Creates a new instance of a Reflection.
-
#instances_of(klass) ⇒ Array<ObjectMirror>
Query the system for objects that are direct instances of the given class.
-
#modules ⇒ Array<ClassMirror>
This method can be used to query the system for known modules.
-
#object_by_id(id) ⇒ ObjectMirror, NilClass
Ask the system to find the object with the given object id.
-
#platform ⇒ String
The platform the system is running on.
-
#reflect(o) ⇒ Mirror
Create a mirror for a given object in the system under observation.
-
#senders_of(message) ⇒ Array<MethodMirror>
Query the system for senders of a particular message.
-
#threads ⇒ Array<ThreadMirror>
Return the currently active threads in the system.
-
#version ⇒ String
The version string describing the system.
Class Method Details
.included(base) ⇒ Object
25 26 27 |
# File 'lib/abstract_reflection.rb', line 25 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#classes ⇒ Array<ClassMirror>
This method can be used to query the system for known classes. It is not guaranteed that all possible classes are returned.
41 42 43 |
# File 'lib/abstract_reflection.rb', line 41 def classes raise CapabilitiesExceeded end |
#engine ⇒ String
Returns the used implementation of Ruby.
86 87 88 |
# File 'lib/abstract_reflection.rb', line 86 def engine raise CapabilitiesExceeded end |
#implementations_of(message) ⇒ Array<MethodMirror>
Query the system for implementors of a particular message
63 64 65 |
# File 'lib/abstract_reflection.rb', line 63 def implementations_of() raise CapabilitiesExceeded end |
#initialize(object) ⇒ Reflection
Creates a new instance of a Reflection
21 22 23 |
# File 'lib/abstract_reflection.rb', line 21 def initialize(object) raise NotImplementedError, "#{self} should have implemented #initialize" end |
#instances_of(klass) ⇒ Array<ObjectMirror>
Query the system for objects that are direct instances of the given class.
49 50 51 |
# File 'lib/abstract_reflection.rb', line 49 def instances_of(klass) raise CapabilitiesExceeded end |
#modules ⇒ Array<ClassMirror>
This method can be used to query the system for known modules. It is not guaranteed that all possible modules are returned.
33 34 35 |
# File 'lib/abstract_reflection.rb', line 33 def modules raise CapabilitiesExceeded end |
#object_by_id(id) ⇒ ObjectMirror, NilClass
Ask the system to find the object with the given object id
56 57 58 |
# File 'lib/abstract_reflection.rb', line 56 def object_by_id(id) raise CapabilitiesExceeded end |
#platform ⇒ String
Returns the platform the system is running on. usually RUBY_PLATFORM.
81 82 83 |
# File 'lib/abstract_reflection.rb', line 81 def platform raise CapabilitiesExceeded end |
#reflect(o) ⇒ Mirror
Create a mirror for a given object in the system under observation.
99 100 101 |
# File 'lib/abstract_reflection.rb', line 99 def reflect(o) Mirror.reflect o, self end |
#senders_of(message) ⇒ Array<MethodMirror>
Query the system for senders of a particular message
70 71 72 |
# File 'lib/abstract_reflection.rb', line 70 def senders_of() raise CapabilitiesExceeded end |
#threads ⇒ Array<ThreadMirror>
Return the currently active threads in the system
76 77 78 |
# File 'lib/abstract_reflection.rb', line 76 def threads raise CapabilitiesExceeded end |
#version ⇒ String
Returns the version string describing the system.
91 92 93 |
# File 'lib/abstract_reflection.rb', line 91 def version raise CapabilitiesExceeded end |